#include <TCPHandler.h>
Inheritance diagram for TCPHandler:
Public Member Functions | |
TCPHandler () | |
TCPHandler (NetSenderBase &theSender, NetReceiverBase &theReceiver) | |
void | setTransmitters (NetSenderBase &theSender, NetReceiverBase &theReceiver) |
virtual void | onReceive (void *someData, int size) |
receives size, collects all data and calls the receiver after that | |
virtual void | onConnect (void) |
sets sender active after the connection is established | |
virtual void | onClose (int reason) |
sets sender inactive after disconnecting | |
virtual void | onSendingDone (void) |
informs the sender that it can send again | |
virtual void | sendPackage (int senderNumber, void *someData, int size) |
called by the sender to send data | |
Private Attributes | |
NetReceiverBase * | receiver |
the associated receiver | |
NetSenderBase * | sender |
the assiciated sender | |
void * | receiveBuffer |
buffer where the data is stored until completly collected | |
int | sizeOfDataToRead |
size of this data | |
bool | sendingDone |
After that the sender calls sendPackage in the TCPHandler and the TCPHandler takes care of sending the data to the other host.
the TCPHandler first sends the size of the data and after that the data itself.
If there is incomining data the TCPHandler first reads the size of the incoming Data and after that all received data is collected in a memory buffer until it is complete. Now the associated receiver is called to stream the data from the buffer.
Definition at line 33 of file TCPHandler.h.
|
Definition at line 36 of file TCPHandler.h. |
|
Definition at line 17 of file TCPHandler.cpp. References NetReceiverBase::getPackage(), NetSenderBase::getPackage(), sender, sendingDone, NetSenderBase::setHandler(), and sizeOfDataToRead. |
Here is the call graph for this function:
|
Definition at line 31 of file TCPHandler.cpp. References sender, and NetSenderBase::setHandler(). |
Here is the call graph for this function:
|
receives size, collects all data and calls the receiver after that
Reimplemented from TCPEndpoint. Definition at line 38 of file TCPHandler.cpp. References ASSERT, NetReceiverBase::getPackage(), NetReceiverBase::onReceive(), and sizeOfDataToRead. |
Here is the call graph for this function:
|
sets sender active after the connection is established
Reimplemented from TCPEndpoint. Definition at line 104 of file TCPHandler.cpp. References NetSenderBase::sendDone(), sender, sendingDone, and sizeOfDataToRead. |
Here is the call graph for this function:
|
sets sender inactive after disconnecting
Reimplemented from TCPEndpoint. Definition at line 112 of file TCPHandler.cpp. |
|
informs the sender that it can send again
Reimplemented from TCPEndpoint. Definition at line 118 of file TCPHandler.cpp. References NetSenderBase::sendDone(), sender, and sendingDone. |
Here is the call graph for this function:
|
called by the sender to send data
Reimplemented from NetHandler. Definition at line 124 of file TCPHandler.cpp. References TCPEndpoint::send(), and sendingDone. |
Here is the call graph for this function:
|
the associated receiver
Definition at line 46 of file TCPHandler.h. |
|
the assiciated sender
Definition at line 47 of file TCPHandler.h. Referenced by onConnect(), onSendingDone(), setTransmitters(), and TCPHandler(). |
|
buffer where the data is stored until completly collected
Reimplemented from IPEndpoint. Definition at line 49 of file TCPHandler.h. |
|
size of this data
Definition at line 50 of file TCPHandler.h. Referenced by onConnect(), onReceive(), and TCPHandler(). |
|
Definition at line 51 of file TCPHandler.h. Referenced by onConnect(), onSendingDone(), sendPackage(), and TCPHandler(). |