Added callback when we read all lines

Added a script callback when all lines have been read.
This commit is contained in:
Nathan Bowhay 2015-02-05 11:41:44 -08:00
parent 014b566014
commit a0250e6c6b
2 changed files with 7 additions and 0 deletions

View file

@ -138,6 +138,10 @@ IMPLEMENT_CALLBACK(TCPObject, onLine, void, (const char* line), (line),
"@param line Data sent from the server.\n" "@param line Data sent from the server.\n"
); );
IMPLEMENT_CALLBACK(TCPObject, onEndReceive, void, (), (),
"@brief Called when we are done reading all lines.\n\n"
);
IMPLEMENT_CALLBACK(TCPObject, onDNSResolved, void, (),(), IMPLEMENT_CALLBACK(TCPObject, onDNSResolved, void, (),(),
"Called whenever the DNS has been resolved.\n" "Called whenever the DNS has been resolved.\n"
); );
@ -499,6 +503,8 @@ void processConnectedReceiveEvent(NetSocket sock, RawData incomingData)
size -= ret; size -= ret;
buffer += ret; buffer += ret;
} }
tcpo->onEndReceive_callback();
} }
void processConnectedAcceptEvent(NetSocket listeningPort, NetSocket newConnection, NetAddress originatingAddress) void processConnectedAcceptEvent(NetSocket listeningPort, NetSocket newConnection, NetAddress originatingAddress)

View file

@ -36,6 +36,7 @@ public:
DECLARE_CALLBACK(void, onConnectionRequest, (const char* address, const char* ID)); DECLARE_CALLBACK(void, onConnectionRequest, (const char* address, const char* ID));
DECLARE_CALLBACK(void, onLine, (const char* line)); DECLARE_CALLBACK(void, onLine, (const char* line));
DECLARE_CALLBACK(void, onEndReceive, ());
DECLARE_CALLBACK(void, onDNSResolved,()); DECLARE_CALLBACK(void, onDNSResolved,());
DECLARE_CALLBACK(void, onDNSFailed, ()); DECLARE_CALLBACK(void, onDNSFailed, ());
DECLARE_CALLBACK(void, onConnected, ()); DECLARE_CALLBACK(void, onConnected, ());