dtn::core::TCPConnection Class Reference

#include <TCPConnection.h>

List of all members.

Public Member Functions

 TCPConnection (TCPConvergenceLayer &clayer, int socket, size_t chunksize=128)
 ~TCPConnection ()
string getRemoteURI ()
bool isClosed ()
TCPConnectionState getState ()
bool waitForState (TCPConnectionState state)

Protected Member Functions

unsigned int transmit (char *data, unsigned int size)
bool datawaiting ()
void transmit ()
void receive ()
int getSocket ()
void handshake (unsigned char *data, unsigned int size)
void idlechecking ()

Private Member Functions

void disconnect ()
void setState (TCPConnectionState state)
void setState (TCPConnectionData &data, TCPConnectionState state)
TCPConnectionState getState (TCPConnectionData &data)
bool waitForState (TCPConnectionData &data, TCPConnectionState state)

Private Attributes

int m_socket
TCPConvergenceLayerm_clayer
string m_eid
TCPConnectionData m_incoming
TCPConnectionData m_outgoing
Mutex m_mutex_state
TCPConnectionState m_state
Conditional m_cond_state
size_t m_chunksize

Friends

class TCPConvergenceLayer


Detailed Description

This class impements a TCP/IP connection.

Constructor & Destructor Documentation

dtn::core::TCPConnection::TCPConnection ( TCPConvergenceLayer clayer,
int  socket,
size_t  chunksize = 128 
)

dtn::core::TCPConnection::~TCPConnection (  ) 

Destructor

References disconnect().


Member Function Documentation

string dtn::core::TCPConnection::getRemoteURI (  ) 

bool dtn::core::TCPConnection::isClosed (  ) 

returns true if the connection is closed

References getState(), and dtn::core::STATE_CLOSED.

Referenced by dtn::core::TCPConvergenceLayer::build_select_list(), and transmit().

TCPConnectionState dtn::core::TCPConnection::getState (  ) 

bool dtn::core::TCPConnection::waitForState ( TCPConnectionState  state  ) 

unsigned int dtn::core::TCPConnection::transmit ( char *  data,
unsigned int  size 
) [protected]

bool dtn::core::TCPConnection::datawaiting (  )  [protected]

this function returns true if there is data to send

References getState(), m_outgoing, dtn::core::STATE_HANDSHAKE, and dtn::core::STATE_TRANSMITTING.

Referenced by dtn::core::TCPConvergenceLayer::build_select_list().

void dtn::core::TCPConnection::transmit (  )  [protected]

void dtn::core::TCPConnection::receive (  )  [protected]

int dtn::core::TCPConnection::getSocket (  )  [protected]

void dtn::core::TCPConnection::handshake ( unsigned char *  data,
unsigned int  size 
) [protected]

void dtn::core::TCPConnection::idlechecking (  )  [protected]

void dtn::core::TCPConnection::disconnect (  )  [private]

void dtn::core::TCPConnection::setState ( TCPConnectionState  state  )  [private]

void dtn::core::TCPConnection::setState ( TCPConnectionData data,
TCPConnectionState  state 
) [private]

TCPConnectionState dtn::core::TCPConnection::getState ( TCPConnectionData data  )  [private]

bool dtn::core::TCPConnection::waitForState ( TCPConnectionData data,
TCPConnectionState  state 
) [private]


Friends And Related Function Documentation

friend class TCPConvergenceLayer [friend]


Member Data Documentation

Referenced by getSocket(), receive(), and transmit().

Referenced by receive().

Referenced by disconnect(), getRemoteURI(), and receive().

Referenced by getState(), and setState().

Referenced by getState(), and setState().

Referenced by transmit().


The documentation for this class was generated from the following files:

Generated on Wed Mar 25 12:41:39 2009 for IBR-DTN by  doxygen 1.5.6