#include <TCPSrvHostApp.h>
Public Member Functions | |
virtual void | init (TCPSrvHostApp *hostmodule, TCPSocket *socket) |
TCPServerThreadBase () | |
virtual | ~TCPServerThreadBase () |
virtual TCPSocket * | getSocket () |
virtual TCPSrvHostApp * | getHostModule () |
virtual void | scheduleAt (simtime_t t, cMessage *msg) |
virtual void | cancelEvent (cMessage *msg) |
Callback methods, called on different socket events. | |
virtual void | established ()=0 |
virtual void | dataArrived (cMessage *msg, bool urgent)=0 |
virtual void | timerExpired (cMessage *timer)=0 |
virtual void | peerClosed () |
virtual void | closed () |
virtual void | failure (int code) |
virtual void | statusArrived (TCPStatusInfo *status) |
Protected Member Functions | |
virtual void | socketDataArrived (int, void *, cPacket *msg, bool urgent) |
virtual void | socketEstablished (int, void *) |
virtual void | socketPeerClosed (int, void *) |
virtual void | socketClosed (int, void *) |
virtual void | socketFailure (int, void *, int code) |
virtual void | socketStatusArrived (int, void *, TCPStatusInfo *status) |
Protected Attributes | |
TCPSrvHostApp * | hostmod |
TCPSocket * | sock |
TCPServerThreadBase::TCPServerThreadBase | ( | ) | [inline] |
virtual void TCPServerThreadBase::socketDataArrived | ( | int | , | |
void * | , | |||
cPacket * | msg, | |||
bool | urgent | |||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketEstablished | ( | int | , | |
void * | ||||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketPeerClosed | ( | int | , | |
void * | ||||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketClosed | ( | int | , | |
void * | ||||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketFailure | ( | int | , | |
void * | , | |||
int | code | |||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketStatusArrived | ( | int | , | |
void * | , | |||
TCPStatusInfo * | status | |||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::init | ( | TCPSrvHostApp * | hostmodule, | |
TCPSocket * | socket | |||
) | [inline, virtual] |
virtual TCPSocket* TCPServerThreadBase::getSocket | ( | ) | [inline, virtual] |
Returns the socket object
Referenced by TCPGenericSrvThread::dataArrived(), and TCPSrvHostApp::removeThread().
00076 {return sock;}
virtual TCPSrvHostApp* TCPServerThreadBase::getHostModule | ( | ) | [inline, virtual] |
virtual void TCPServerThreadBase::scheduleAt | ( | simtime_t | t, | |
cMessage * | msg | |||
) | [inline, virtual] |
Schedule an event. Do not use getContextPointer() of cMessage, because TCPServerThreadBase uses it for its own purposes.
00085 {msg->setContextPointer(this); hostmod->scheduleAt(t,msg);}
virtual void TCPServerThreadBase::cancelEvent | ( | cMessage * | msg | ) | [inline, virtual] |
virtual void TCPServerThreadBase::established | ( | ) | [pure virtual] |
Called when connection is established. To be redefined.
Implemented in TCPGenericSrvThread.
virtual void TCPServerThreadBase::dataArrived | ( | cMessage * | msg, | |
bool | urgent | |||
) | [pure virtual] |
Called when a data packet arrives. To be redefined.
Implemented in TCPGenericSrvThread.
virtual void TCPServerThreadBase::timerExpired | ( | cMessage * | timer | ) | [pure virtual] |
Called when a timer (scheduled via scheduleAt()) expires. To be redefined.
Implemented in TCPGenericSrvThread.
Referenced by TCPSrvHostApp::handleMessage().
virtual void TCPServerThreadBase::peerClosed | ( | ) | [inline, virtual] |
virtual void TCPServerThreadBase::closed | ( | ) | [inline, virtual] |
Called when the connection closes (successful TCP teardown). By default it deletes this thread, but it can be redefined to do something different.
00117 {hostmod->removeThread(this);}
virtual void TCPServerThreadBase::failure | ( | int | code | ) | [inline, virtual] |
Called when the connection breaks (TCP error). By default it deletes this thread, but it can be redefined to do something different.
00123 {hostmod->removeThread(this);}
virtual void TCPServerThreadBase::statusArrived | ( | TCPStatusInfo * | status | ) | [inline, virtual] |
Called when a status arrives in response to getSocket()->getStatus(). By default it deletes the status object, redefine it to add code to examine the status.
TCPSrvHostApp* TCPServerThreadBase::hostmod [protected] |
TCPSocket* TCPServerThreadBase::sock [protected] |