TSDuck v3.45-4686
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SocketHandlerInterface Class Reference

Interface class for notification of open/close on sockets. More...

#include <tsSocketHandlerInterface.h>

Inheritance diagram for ts::SocketHandlerInterface:

Public Member Functions

virtual void handleSocketCloseComplete (Socket &sock, bool silent, bool success)
 Called after a socket is closed.
 
virtual void handleSocketCloseStart (Socket &sock, bool silent)
 Called when a socket is about to be closed.
 
virtual void handleSocketConnected (TCPConnection &sock)
 Called when a TCP socket is successfully connected.
 
virtual void handleSocketDisconnected (TCPConnection &sock, bool silent)
 Called when a TCP socket is disconnected.
 
virtual void handleSocketOpenComplete (Socket &sock, bool success)
 Called after a socket is opened (or failed to open).
 
virtual void handleSocketOpenStart (Socket &sock)
 Called when a socket is about to be opened.
 

Detailed Description

Interface class for notification of open/close on sockets.

All methods are empty by default. An application may implement the required ones only.

Member Function Documentation

◆ handleSocketOpenStart()

virtual void ts::SocketHandlerInterface::handleSocketOpenStart ( Socket sock)
virtual

Called when a socket is about to be opened.

Never called when the application tries to open a socket which is already open.

Parameters
[in,out]sockSocket for which the handler is invoked.

◆ handleSocketOpenComplete()

virtual void ts::SocketHandlerInterface::handleSocketOpenComplete ( Socket sock,
bool  success 
)
virtual

Called after a socket is opened (or failed to open).

Parameters
[in,out]sockSocket for which the handler is invoked.
[in]successTrue if the open was successful, false if the open failed. In case of error, the socket shall be considered as closed.

◆ handleSocketConnected()

virtual void ts::SocketHandlerInterface::handleSocketConnected ( TCPConnection sock)
virtual

Called when a TCP socket is successfully connected.

Parameters
[in,out]sockSocket for which the handler is invoked.

Reimplemented in ts::tlv::Connection< SAFETY >, ts::tlv::Connection< ThreadSafety::Full >, and ts::tlv::Connection< ThreadSafety::None >.

◆ handleSocketDisconnected()

virtual void ts::SocketHandlerInterface::handleSocketDisconnected ( TCPConnection sock,
bool  silent 
)
virtual

Called when a TCP socket is disconnected.

Parameters
[in,out]sockSocket for which the handler is invoked.
[in]silentSame value as passed to disconnect() or close().

◆ handleSocketCloseStart()

virtual void ts::SocketHandlerInterface::handleSocketCloseStart ( Socket sock,
bool  silent 
)
virtual

Called when a socket is about to be closed.

Never called when the application tries to close a socket which is not open.

Parameters
[in,out]sockSocket for which the handler is invoked.
[in]silentSame value as passed to close().

◆ handleSocketCloseComplete()

virtual void ts::SocketHandlerInterface::handleSocketCloseComplete ( Socket sock,
bool  silent,
bool  success 
)
virtual

Called after a socket is closed.

Parameters
[in,out]sockSocket for which the handler is invoked.
[in]silentSame value as passed to close().
[in]successTrue if the close was successful, false if there was an error during the close. The socket shall be considered as closed on all cases, regardless of success.

The documentation for this class was generated from the following file: