TSDuck v3.44-4659
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::ReactiveUDPHandlerInterface Class Reference

Interface class for UDP operation Reactor handlers. More...

#include <tsReactiveUDPHandlerInterface.h>

Public Member Functions

virtual void handleUDPClosed (ReactiveUDPSocket &sock)
 Handle the completion of closing a UDP socket.
 
virtual void handleUDPReceive (ReactiveUDPSocket &sock, const ByteBlockPtr &data, const IPSocketAddress &sender, const IPSocketAddress &destination, cn::microseconds timestamp, UDPSocket::TimeStampType timestamp_type, int error_code)
 Handle the reception of a UDP datagram.
 
virtual void handleUDPSend (ReactiveUDPSocket &sock, const void *data, size_t size, const IPSocketAddress &destination, int error_code)
 Handle the completion of a send operation on a UDP socket.
 

Detailed Description

Interface class for UDP operation Reactor handlers.

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

Member Function Documentation

◆ handleUDPSend()

virtual void ts::ReactiveUDPHandlerInterface::handleUDPSend ( ReactiveUDPSocket sock,
const void *  data,
size_t  size,
const IPSocketAddress destination,
int  error_code 
)
virtual

Handle the completion of a send operation on a UDP socket.

Parameters
[in,out]sockUDP socket for which the handler is invoked.
[in]dataAddress of the message which was sent. For information only.
[in]sizeSize in bytes of the sent message. For information only.
[in]destinationSocket address of the destination. For information only.
[in]error_codeSystem-specific error code, zero on success, SYS_ERROR in case of unknown error, SYS_CANCELED if the I/O was canceled before completion.

◆ handleUDPReceive()

virtual void ts::ReactiveUDPHandlerInterface::handleUDPReceive ( ReactiveUDPSocket sock,
const ByteBlockPtr data,
const IPSocketAddress sender,
const IPSocketAddress destination,
cn::microseconds  timestamp,
UDPSocket::TimeStampType  timestamp_type,
int  error_code 
)
virtual

Handle the reception of a UDP datagram.

Parameters
[in,out]sockUDP socket for which the handler is invoked.
[in]dataSafe pointer to the received data packet.
[in]senderSocket address of the sender.
[in]destinationSocket address of the packet destination. Useful in multicast packets.
[in]timestampReceive timestamp in micro-seconds. If the value is negative, no timestamp is available.
[in]timestamp_typeType of receive timestamp.
[in]error_codeSystem-specific error code, zero on success, SYS_ERROR in case of unknown error.

◆ handleUDPClosed()

virtual void ts::ReactiveUDPHandlerInterface::handleUDPClosed ( ReactiveUDPSocket sock)
virtual

Handle the completion of closing a UDP socket.

An application closes a ReactiveUDPSocket 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 UDPSocket::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 handleUDPClosed() handler to destroy the data buffers and consider the socket as completely done.

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

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