DUNE: Uniform Navigational Environment
2017.01.0
|
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 (const Address &add, uint16_t port) |
void | listen (int backlog) |
TCPSocket * | accept (Address *a=0, uint16_t *port=0) |
bool | writeFile (const char *filename, int64_t off_end, int64_t off_beg=-1) |
void | setKeepAlive (bool enabled) |
void | setNoDelay (bool enabled) |
void | setReceiveTimeout (double timeout) |
void | setSendTimeout (double timeout) |
Address | getBoundAddress (void) |
uint16_t | getBoundPort (void) |
Public Member Functions inherited from DUNE::IO::Handle | |
virtual | ~Handle (void) |
size_t | write (const uint8_t *data, size_t length) |
size_t | write (const char *data, size_t length) |
size_t | writeString (const char *cstr) |
size_t | read (uint8_t *data, size_t length) |
size_t | read (char *data, size_t length) |
size_t | readString (char *bfr, size_t length) |
void | flush (void) |
void | flushInput (void) |
void | flushOutput (void) |
NativeHandle | getNative (void) const |
Additional Inherited Members | |
Protected Member Functions inherited from DUNE::IO::Handle | |
virtual void | doFlushOutput (void) |
virtual void | doFlush (void) |
DUNE::Network::TCPSocket::TCPSocket | ( | bool | create = true | ) |
Create an unbound TCP socket.
Referenced by accept().
DUNE::Network::TCPSocket::~TCPSocket | ( | void | ) |
Destroy an TCP socket.
References DUNE::Utils::ByteCopy::fromBE(), and TCPSocket().
void DUNE::Network::TCPSocket::bind | ( | uint16_t | port = 0 , |
Address | add = Address::Any , |
||
bool | reuse = true |
||
) |
Assign a name to a socket.
References DUNE::Utils::ByteCopy::toBE(), and DUNE::Network::Address::toInteger().
void DUNE::Network::TCPSocket::connect | ( | const Address & | add, |
uint16_t | port | ||
) |
References DUNE::Utils::ByteCopy::toBE(), and DUNE::Network::Address::toInteger().
Address DUNE::Network::TCPSocket::getBoundAddress | ( | void | ) |
References DUNE::Network::Address, and DUNE::Utils::ByteCopy::fromBE().
uint16_t DUNE::Network::TCPSocket::getBoundPort | ( | void | ) |
References DUNE::Utils::ByteCopy::fromBE().
void DUNE::Network::TCPSocket::listen | ( | int | backlog | ) |
void DUNE::Network::TCPSocket::setKeepAlive | ( | bool | enabled | ) |
Enable/disable keep-alive messages.
When enabled connections are kept active by periodically transmitting messages.
[in] | enabled | true to enable this feature, false to disable. |
void DUNE::Network::TCPSocket::setNoDelay | ( | bool | enabled | ) |
Disable/enable the Nagle algorithm.
[in] | enabled | true 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.
[in] | timeout | timeout 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.
[in] | timeout | timeout value in second. |
Referenced by Transports::FTP::Session::Session().
bool DUNE::Network::TCPSocket::writeFile | ( | const char * | filename, |
int64_t | off_end, | ||
int64_t | off_beg = -1 |
||
) |
References DUNE::IO::Handle::write(), and DUNE::Concurrency::Scheduler::yield().