DUNE: Uniform Navigational Environment  2.3.1
DUNE::Network::TCPSocket Class Reference

Detailed Description

TCP Socket.

Public Member Functions

 TCPSocket (bool create=true)
 
 ~TCPSocket (void)
 
void bind (uint16_t port=0, Address add=Address::Any, bool reuse=true)
 
void connect (Address add, uint16_t port)
 
void listen (int backlog)
 
TCPSocketaccept (Address *a=0, uint16_t *port=0)
 
int write (const char *buffer, int len)
 
int read (char *buffer, int len)
 
bool writeFile (const char *filename, int64_t off_end, int64_t off_beg=-1)
 
void addToPoll (System::IOMultiplexing &p)
 
void delFromPoll (System::IOMultiplexing &p)
 
bool wasTriggered (System::IOMultiplexing &p)
 
void setKeepAlive (bool enabled)
 
void setNoDelay (bool enabled)
 
void setReceiveTimeout (double timeout)
 
void setSendTimeout (double timeout)
 
Address getBoundAddress (void)
 
uint16_t getBoundPort (void)
 

Constructor & Destructor Documentation

DUNE::Network::TCPSocket::TCPSocket ( bool  create = true)

Create an unbound TCP socket.

Referenced by accept().

DUNE::Network::TCPSocket::~TCPSocket ( void  )

Destroy an TCP socket.

Member Function Documentation

TCPSocket * DUNE::Network::TCPSocket::accept ( Address a = 0,
uint16_t *  port = 0 
)
void DUNE::Network::TCPSocket::bind ( uint16_t  port = 0,
Address  add = Address::Any,
bool  reuse = true 
)
void DUNE::Network::TCPSocket::connect ( Address  add,
uint16_t  port 
)
void DUNE::Network::TCPSocket::delFromPoll ( System::IOMultiplexing p)
Address DUNE::Network::TCPSocket::getBoundAddress ( void  )
uint16_t DUNE::Network::TCPSocket::getBoundPort ( void  )
void DUNE::Network::TCPSocket::listen ( int  backlog)
int DUNE::Network::TCPSocket::read ( char *  buffer,
int  len 
)
void DUNE::Network::TCPSocket::setKeepAlive ( bool  enabled)

Enable/disable keep-alive messages.

When enabled connections are kept active by periodically transmitting messages.

Parameters
[in]enabledtrue to enable this feature, false to disable.
void DUNE::Network::TCPSocket::setNoDelay ( bool  enabled)

Disable/enable the Nagle algorithm.

Parameters
[in]enabledtrue to disable Nagle algorithm, false to enable.

Referenced by Transports::FTP::Session::Session().

void DUNE::Network::TCPSocket::setReceiveTimeout ( double  timeout)

Set the timeout value that specifies the maximum amount of time an input function waits until it completes.

Parameters
[in]timeouttimeout value in second.

Referenced by Transports::FTP::Session::Session().

void DUNE::Network::TCPSocket::setSendTimeout ( double  timeout)

Set the timeout value specifying the amount of time that an output function blocks because flow control prevents data from being sent.

Parameters
[in]timeouttimeout value in second.

Referenced by Transports::FTP::Session::Session().

bool DUNE::Network::TCPSocket::wasTriggered ( System::IOMultiplexing p)
bool DUNE::Network::TCPSocket::writeFile ( const char *  filename,
int64_t  off_end,
int64_t  off_beg = -1 
)
Collaboration diagram for DUNE::Network::TCPSocket:
Collaboration graph