![]() |
TSDuck v3.46-4806
MPEG Transport Stream Toolkit
|
Interface class for TCP connection Reactor handlers. More...
#include <tsReactiveTCPConnectionHandlerInterface.h>


Public Member Functions | |
| virtual void | handleReadStream (ReactiveStream &stream, const ByteBlockPtr &data, ReactiveInputControl &control, int error_code, const ObjectPtr &user_data) |
| Handle the reception of data from a read operation on a stream. | |
| virtual void | handleTCPAccepted (ReactiveTCPServer &server, ReactiveTCPConnection &sock, int error_code, const ObjectPtr &user_data) |
| Handle the completion of a client connection of a TCP socket in the context of a server. | |
| virtual void | handleTCPClosed (ReactiveTCPConnection &sock, const ObjectPtr &user_data) |
| Handle the completion of closing a TCP socket. | |
| virtual void | handleTCPConnected (ReactiveTCPConnection &sock, int error_code, const ObjectPtr &user_data) |
| Handle the completion of a connection of a TCP socket. | |
| virtual void | handleWriteStream (ReactiveStream &stream, int error_code, const ObjectPtr &user_data) |
| Handle the completion of a write operation on a stream. | |
Interface class for TCP connection Reactor handlers.
All methods are empty by default. An application may implement the required ones only.
|
virtual |
Handle the completion of a connection of a TCP socket.
| [in,out] | sock | TCP socket for which the handler is invoked. |
| [in] | error_code | System-specific error code, SYS_SUCCESS on success, SYS_ERROR in case of unknown error, SYS_CANCELED if the connection was canceled before completion. |
| [in] | user_data | The user-data shared pointer which was passed to startConnect(). |
Reimplemented in ts::ReactiveTLSConnection.
|
virtual |
Handle the completion of a client connection of a TCP socket in the context of a server.
| [in,out] | server | TCP server in the context of which sock is starting a new client session. |
| [in,out] | sock | TCP socket for which the handler is invoked. |
| [in] | error_code | System-specific error code, SYS_SUCCESS on success, SYS_ERROR in case of unknown error. |
| [in] | user_data | The user-data shared pointer which was passed to whenAccepted(). |
Reimplemented in ts::ReactiveTLSConnection.
|
virtual |
Handle the completion of closing a TCP socket.
An application closes a ReactiveTCPConnection 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] | sock | TCP socket for which the handler is invoked. |
| [in] | user_data | The user-data shared pointer which was passed to startClose(). |
Reimplemented in ts::ReactiveTLSConnection.
|
virtualinherited |
Handle the completion of a write operation on a stream.
| [in,out] | stream | Stream device for which the handler is invoked. |
| [in] | error_code | System-specific error code, including:
|
| [in] | user_data | The user-data shared pointer which was passed to startWriteStream(). |
Reimplemented in ts::ReactiveTLSConnection.
|
virtualinherited |
Handle the reception of data from a read operation on a stream.
| [in,out] | stream | Stream device for which the handler is invoked. |
| [in] | data | Shared pointer to the received data. Can be the null pointer in case of error. The handler may safely copy the shared pointer, the pointed data will not be modified by the ReactiveStream. If the returned control specifies that not all input was used, the remaining data in the buffer will be reallocated in a new ByteBlock in the ReactiveStream, after handleReadStream() returns. |
| [in,out] | control | Input control data that the handler may update according to the usage of data. |
| [in] | error_code | System-specific error code, including:
|
| [in] | user_data | The user-data shared pointer which was passed to startReadStream(). |
Reimplemented in ts::ReactiveTLSConnection.