IBR-DTNSuite
0.8
|
#include <tcpserver.h>
Public Member Functions | |
tcpserver () | |
tcpserver (const ibrcommon::File &socket) | |
void | bind (const vinterface &net, int port, bool reuseaddr=true) |
void | bind (int port, bool reuseaddr=true) |
void | listen (int connections) |
virtual | ~tcpserver () |
tcpstream * | accept () |
void | close () |
void | shutdown () |
Definition at line 20 of file tcpserver.h.
ibrcommon::tcpserver::tcpserver | ( | const ibrcommon::File & | socket | ) |
creates a tcpserver bound to a filesocket
socket |
Definition at line 22 of file tcpserver.cpp.
References ibrcommon::vsocket::bind(), and listen().
ibrcommon::tcpserver::~tcpserver | ( | ) | [virtual] |
Destructor
Definition at line 76 of file tcpserver.cpp.
References close().
Accept a new connection.
Definition at line 91 of file tcpserver.cpp.
References close(), and ibrcommon::vsocket::select().
Referenced by dtn::api::ApiServer::componentRun().
void ibrcommon::tcpserver::bind | ( | const vinterface & | net, |
int | port, | ||
bool | reuseaddr = true |
||
) |
address | the address to listen to |
port | the port to listen to |
Definition at line 55 of file tcpserver.cpp.
References ibrcommon::vsocket::bind(), ibrcommon::vsocket::listen(), ibrcommon::vsocket::set(), ibrcommon::vsocket::VSOCKET_LINGER, ibrcommon::vsocket::VSOCKET_NONBLOCKING, and ibrcommon::vsocket::VSOCKET_REUSEADDR.
Referenced by dtn::api::ApiServer::ApiServer().
void ibrcommon::tcpserver::bind | ( | int | port, |
bool | reuseaddr = true |
||
) |
port | the port to listen to |
Definition at line 36 of file tcpserver.cpp.
References ibrcommon::vsocket::bind(), ibrcommon::vsocket::listen(), ibrcommon::vsocket::set(), ibrcommon::vsocket::VSOCKET_LINGER, ibrcommon::vsocket::VSOCKET_NONBLOCKING, and ibrcommon::vsocket::VSOCKET_REUSEADDR.
void ibrcommon::tcpserver::close | ( | ) |
Definition at line 81 of file tcpserver.cpp.
References ibrcommon::vsocket::close().
Referenced by accept(), dtn::api::ApiServer::componentDown(), and ~tcpserver().
void ibrcommon::tcpserver::listen | ( | int | connections | ) |
listen on all sockets bound to
connections |
Definition at line 31 of file tcpserver.cpp.
References ibrcommon::vsocket::listen().
Referenced by dtn::api::ApiServer::componentUp(), and tcpserver().
void ibrcommon::tcpserver::shutdown | ( | ) |
Definition at line 86 of file tcpserver.cpp.
References ibrcommon::vsocket::shutdown().
Referenced by dtn::api::ApiServer::__cancellation().