![]() |
TSDuck v3.45-4686
MPEG Transport Stream Toolkit
|
Interface class for TCP server Reactor handlers. More...
#include <tsReactiveTCPServerHandlerInterface.h>
Public Member Functions | |
| virtual void | handleTCPClientAccepted (ReactiveTCPServer &server, ReactiveTCPConnection &sock, IPSocketAddress &addr, int error_code, const ObjectPtr &user_data) |
| Handle the reception of TCP data. | |
| virtual void | handleTCPServerClosed (ReactiveTCPServer &server, const ObjectPtr &user_data) |
| Handle the completion of closing a TCP server socket. | |
Interface class for TCP server Reactor handlers.
All methods are empty by default. An application may implement the required ones only.
|
virtual |
Handle the reception of TCP data.
| [in,out] | server | TCP server socket for which the handler is invoked. |
| [in,out] | sock | TCP connection socket of the newly accepted client. |
| [in] | addr | Socket address of the client. |
| [in] | error_code | System-specific error code, SYS_SUCCESS on success, SYS_EOF if the peer has disconnected, SYS_ERROR in case of unknown error. |
| [in] | user_data | The user-data shared pointer which was passed to startAccept(). |
|
virtual |
Handle the completion of closing a TCP server socket.
An application closes a ReactiveTCPServer using startClose() and this handler is called when the closing of the socket is complete. This is specifically important on operating systems with asynchronous I/O such as Windows. The application shall not call TCPSocket::close() and immediately consider the socket as done. If there are pending asynchronous I/O, the associated data buffers are still in use, until the cancelation of the these I/O are completed, after closing the socket. The application shall therefore wait for the handleTCPClosed() handler to destroy the data buffers and consider the socket as completely done.
| [in,out] | server | TCP server socket for which the handler is invoked. |
| [in] | user_data | The user-data shared pointer which was passed to startClose(). |