Interface class for UDP operation Reactor handlers.
More...
#include <tsReactiveUDPHandlerInterface.h>
|
| virtual void | handleUDPClosed (ReactiveUDPSocket &sock, const ObjectPtr &user_data) |
| | 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, const ObjectPtr &user_data) |
| | Handle the reception of a UDP datagram.
|
| |
| virtual void | handleUDPSend (ReactiveUDPSocket &sock, const void *data, size_t size, const IPSocketAddress &destination, int error_code, const ObjectPtr &user_data) |
| | Handle the completion of a send operation on a UDP socket.
|
| |
Interface class for UDP operation Reactor handlers.
All methods are empty by default. An application may implement the required ones only.
◆ handleUDPSend()
Handle the completion of a send operation on a UDP socket.
- Parameters
-
| [in,out] | sock | UDP socket for which the handler is invoked. |
| [in] | data | Address of the message which was sent. For information only. |
| [in] | size | Size in bytes of the sent message. For information only. |
| [in] | destination | Socket address of the destination. For information only. |
| [in] | error_code | System-specific error code, SYS_SUCCESS on success, SYS_ERROR in case of unknown error, SYS_CANCELED if the I/O was canceled before completion. |
| [in] | user_data | The user-data shared pointer which was passed to startSend(). |
◆ handleUDPReceive()
Handle the reception of a UDP datagram.
- Parameters
-
| [in,out] | sock | UDP socket for which the handler is invoked. |
| [in] | data | Safe pointer to the received data packet. Can be null in case of error. The handler may safely copy the shared pointer, the pointed data will not be modified by the ReactiveUDPSocker. |
| [in] | sender | Socket address of the sender. |
| [in] | destination | Socket address of the packet destination. Useful in multicast packets. |
| [in] | timestamp | Receive timestamp in micro-seconds. If the value is negative, no timestamp is available. |
| [in] | timestamp_type | Type of receive timestamp. |
| [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 startReceive(). |
◆ handleUDPClosed()
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] | sock | UDP socket for which the handler is invoked. |
| [in] | user_data | The user-data shared pointer which was passed to startClose(). |
The documentation for this class was generated from the following file: