@@ -98,6 +98,20 @@ class Net_API TCPServer: public Poco::Runnable
9898 // / Already served connections, however, will continue being served.
9999{
100100public:
101+ TCPServer (TCPServerConnectionFactory::Ptr pFactory, Poco::UInt16 portNumber = 0 , TCPServerParams::Ptr pParams = 0 );
102+ // / Creates the TCPServer, with ServerSocket listening on the given port.
103+ // / Default port is zero, allowing any availble port. The port number
104+ // / can be queried through TCPServer::port() member.
105+ // /
106+ // / The server takes ownership of the TCPServerConnectionFactory
107+ // / and deletes it when it's no longer needed.
108+ // /
109+ // / The server also takes ownership of the TCPServerParams object.
110+ // / If no TCPServerParams object is given, the server's TCPServerDispatcher
111+ // / creates its own one.
112+ // /
113+ // / New threads are taken from the default thread pool.
114+
101115 TCPServer (TCPServerConnectionFactory::Ptr pFactory, const ServerSocket& socket, TCPServerParams::Ptr pParams = 0 );
102116 // / Creates the TCPServer, using the given ServerSocket.
103117 // /
@@ -163,6 +177,9 @@ class Net_API TCPServer: public Poco::Runnable
163177 int refusedConnections () const ;
164178 // / Returns the number of refused connections.
165179
180+ const ServerSocket& socket () const ;
181+ // / Returns the underlying server socket.
182+
166183 Poco::UInt16 port () const ;
167184 // / Returns the port the server socket listens on.
168185
@@ -188,6 +205,12 @@ class Net_API TCPServer: public Poco::Runnable
188205};
189206
190207
208+ inline const ServerSocket& TCPServer::socket () const
209+ {
210+ return _socket;
211+ }
212+
213+
191214inline Poco::UInt16 TCPServer::port () const
192215{
193216 return _socket.address ().port ();
0 commit comments