Commit 335696c8 authored by jan.koester's avatar jan.koester
Browse files

add sending support

parent 26927798
Loading
Loading
Loading
Loading
+7 −0
Changes for src/connection.cpp: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -145,6 +145,11 @@ unsigned long netplus::con::getRecvLength(){
  return _ReadDataLength;
}

void netplus::con::sending(bool state) {
    _sending = state;
    _eventapi->sendReady(this,state);
}

netplus::con::condata* netplus::con::_resizeQueue(condata** firstdata, condata** lastdata,
    unsigned long& qsize, unsigned long size) {
    if (!*firstdata || size > qsize) {
@@ -257,6 +262,7 @@ netplus::con::con(eventapi *event){
    _SendDataLast=nullptr;
    _SendDataLength=0;
    _eventapi=event;
    _sending=false;
}

netplus::con::con(){
@@ -267,6 +273,7 @@ netplus::con::con(){
    _SendDataLast=nullptr;
    _SendDataLength=0;
    _eventapi=nullptr;
    _sending=false;
}

netplus::con::~con(){
+6 −0
Changes for src/connection.h: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@ namespace netplus {
            
            /*clientsocket*/
            socket  *csock;

            /*set sending state*/
            void    sending(bool state);
        protected:
            con();
            /*Incomming Data*/
@@ -92,6 +95,9 @@ namespace netplus {
            condata  *_SendDataLast;
            eventapi *_eventapi;
            
            /*if pollout*/
            bool      _sending;

            friend class event;
        };
};