|
pion-net
4.0.9
|
simple TCP server that just sends "Hello there!" to each connection More...
Inherits pion::net::TCPServer.
Public Member Functions | |
| HelloServer (const unsigned int tcp_port) | |
| virtual void | handleConnection (TCPConnectionPtr &tcp_conn) |
Public Member Functions inherited from pion::net::TCPServer | |
| virtual | ~TCPServer () |
| default destructor | |
| void | start (void) |
| starts listening for new connections | |
| void | stop (bool wait_until_finished=false) |
| void | join (void) |
| the calling thread will sleep until the server has stopped listening for connections | |
| void | setSSLKeyFile (const std::string &pem_key_file) |
| std::size_t | getConnections (void) const |
| returns the number of active tcp connections | |
| unsigned int | getPort (void) const |
| returns tcp port number that the server listens for connections on | |
| void | setPort (unsigned int p) |
| sets tcp port number that the server listens for connections on | |
| boost::asio::ip::address | getAddress (void) const |
| returns IP address that the server listens for connections on | |
| void | setAddress (const boost::asio::ip::address &addr) |
| sets IP address that the server listens for connections on | |
| const boost::asio::ip::tcp::endpoint & | getEndpoint (void) const |
| returns tcp endpoint that the server listens for connections on | |
| void | setEndpoint (const boost::asio::ip::tcp::endpoint &ep) |
| sets tcp endpoint that the server listens for connections on | |
| bool | getSSLFlag (void) const |
| returns true if the server uses SSL to encrypt connections | |
| void | setSSLFlag (bool b=true) |
| sets value of SSL flag (true if the server uses SSL to encrypt connections) | |
| TCPConnection::SSLContext & | getSSLContext (void) |
| returns the SSL context for configuration | |
| bool | isListening (void) const |
| returns true if the server is listening for connections | |
| void | setLogger (PionLogger log_ptr) |
| sets the logger to be used | |
| PionLogger | getLogger (void) |
| returns the logger currently in use | |
Additional Inherited Members | |
Protected Member Functions inherited from pion::net::TCPServer | |
| TCPServer (const unsigned int tcp_port) | |
| TCPServer (const boost::asio::ip::tcp::endpoint &endpoint) | |
| TCPServer (PionScheduler &scheduler, const unsigned int tcp_port=0) | |
| TCPServer (PionScheduler &scheduler, const boost::asio::ip::tcp::endpoint &endpoint) | |
| virtual void | beforeStarting (void) |
| called before the TCP server starts listening for new connections | |
| virtual void | afterStopping (void) |
| called after the TCP server has stopped listing for new connections | |
| boost::asio::io_service & | getIOService (void) |
| returns an async I/O service used to schedule work | |
Protected Attributes inherited from pion::net::TCPServer | |
| PionLogger | m_logger |
| primary logging interface used by this class | |
simple TCP server that just sends "Hello there!" to each connection
Definition at line 22 of file PionHelloServer.cpp.
|
inlinevirtual |
handles a new TCP connection; derived classes SHOULD override this since the default behavior does nothing
| tcp_conn | the new TCP connection to handle |
Reimplemented from pion::net::TCPServer.
Definition at line 26 of file PionHelloServer.cpp.
1.8.11