#include <TCPSrvHostApp.h>
Inheritance diagram for TCPServerThreadBase:
Public Member Functions | |
void | init (TCPSrvHostApp *hostmodule, TCPSocket *socket) |
TCPServerThreadBase () | |
virtual | ~TCPServerThreadBase () |
TCPSocket * | socket () |
TCPSrvHostApp * | hostModule () |
void | scheduleAt (simtime_t t, cMessage *msg) |
void | cancelEvent (cMessage *msg) |
simtime_t | simTime () |
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 *, cMessage *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) |
Private Attributes | |
TCPSrvHostApp * | hostmod |
TCPSocket * | sock |
TCPServerThreadBase::TCPServerThreadBase | ( | ) | [inline] |
void TCPServerThreadBase::cancelEvent | ( | cMessage * | msg | ) | [inline] |
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.
00119 {hostmod->removeThread(this);}
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::established | ( | ) | [pure virtual] |
Called when connection is established. To be redefined.
Implemented in TCPGenericSrvThread.
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.
00125 {hostmod->removeThread(this);}
TCPSrvHostApp* TCPServerThreadBase::hostModule | ( | ) | [inline] |
void TCPServerThreadBase::init | ( | TCPSrvHostApp * | hostmodule, | |
TCPSocket * | socket | |||
) | [inline] |
virtual void TCPServerThreadBase::peerClosed | ( | ) | [inline, virtual] |
void TCPServerThreadBase::scheduleAt | ( | simtime_t | t, | |
cMessage * | msg | |||
) | [inline] |
Schedule an event. Do not use contextPointer() of cMessage, because TCPServerThreadBase uses it for its own purposes.
00084 {msg->setContextPointer(this); hostmod->scheduleAt(t,msg);}
simtime_t TCPServerThreadBase::simTime | ( | ) | [inline] |
virtual void TCPServerThreadBase::socketClosed | ( | int | , | |
void * | ||||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketDataArrived | ( | int | , | |
void * | , | |||
cMessage * | msg, | |||
bool | urgent | |||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketEstablished | ( | int | , | |
void * | ||||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketFailure | ( | int | , | |
void * | , | |||
int | code | |||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketPeerClosed | ( | int | , | |
void * | ||||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::socketStatusArrived | ( | int | , | |
void * | , | |||
TCPStatusInfo * | status | |||
) | [inline, protected, virtual] |
virtual void TCPServerThreadBase::statusArrived | ( | TCPStatusInfo * | status | ) | [inline, virtual] |
Called when a status arrives in response to socket()->status(). By default it deletes the status object, redefine it to add code to examine the status.
virtual void TCPServerThreadBase::timerExpired | ( | cMessage * | timer | ) | [pure virtual] |
Called when a timer (scheduled via scheduleAt()) expires. To be redefined.
Implemented in TCPGenericSrvThread.
TCPSrvHostApp* TCPServerThreadBase::hostmod [private] |
TCPSocket* TCPServerThreadBase::sock [private] |