#include <network_ip_udp.h>
An asynchronous UDP channel.
Public Types | |
using | ReceiveCompletionHandler = Delegate< Result< void >(Result< void >, AioBuffer, NetworkIpAddrPort)> |
using | SendCompletionHandler = Delegate< Result< void >(Result< void >)> |
Public Member Functions | |
MAXON_METHOD Result< void > | Receive (const AioStatusRef &status, ReceiveCompletionHandler handler) |
MAXON_METHOD Result< void > | Receive (ReceiveCompletionHandler handler) |
MAXON_METHOD Result< void > | Send (const AioStatusRef &status, AioBuffer data, const NetworkIpAddrPort &destAddress, SendCompletionHandler handler=DefaultSendCompletionHandler) |
MAXON_METHOD Result< void > | Send (AioBuffer data, const NetworkIpAddrPort &destAddress, SendCompletionHandler handler=DefaultSendCompletionHandler) |
MAXON_METHOD AioServiceRef | GetIoService () const |
MAXON_METHOD JobQueueRef | GetJobQueue () const |
Static Public Member Functions | |
static Result< void > | DefaultSendCompletionHandler (Result< void > res) |
Private Member Functions | |
MAXON_INTERFACE (NetworkUdpChannelInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.networkudpchannel") | |
Private Member Functions inherited from AioReaderInterface | |
MAXON_METHOD Result< void > | NotifyForRead (SocketT sockfd, Result< void > result) |
Private Member Functions inherited from AioWriterInterface | |
MAXON_METHOD Result< void > | NotifyForWrite (SocketT sockfd, Result< void > result) |
using ReceiveCompletionHandler = Delegate<Result<void>(Result<void>, AioBuffer, NetworkIpAddrPort)> |
using SendCompletionHandler = Delegate<Result<void>(Result<void>)> |
|
private |
MAXON_METHOD Result<void> Receive | ( | const AioStatusRef & | status, |
ReceiveCompletionHandler | handler | ||
) |
Enqueues an asynchronous receive request. As soon as data has been received, the given handler delegate is called. A status instance can be used to synchronously wait on the operation and check its success.
[in] | status | Status monitor for the operation. |
[in] | handler | Handler delegate. |
MAXON_METHOD Result<void> Receive | ( | ReceiveCompletionHandler | handler | ) |
Equivalent to Receive(AioStatusRef(), handler).
MAXON_METHOD Result<void> Send | ( | const AioStatusRef & | status, |
AioBuffer | data, | ||
const NetworkIpAddrPort & | destAddress, | ||
SendCompletionHandler | handler = DefaultSendCompletionHandler |
||
) |
Enqueues an asynchronous send request. As soon as data has been sent, the given handler delegate is called. A status instance can be used to synchronously wait on the operation and check its success.
[in] | status | Status monitor for the operation. |
[in] | data | Buffer containing data to be sent. |
[in] | destAddress | Destination address. |
[in] | handler | Handler delegate. |
MAXON_METHOD Result<void> Send | ( | AioBuffer | data, |
const NetworkIpAddrPort & | destAddress, | ||
SendCompletionHandler | handler = DefaultSendCompletionHandler |
||
) |
Equivalent to Send(AioStatusRef(), data, destAddress, handler).
MAXON_METHOD AioServiceRef GetIoService | ( | ) | const |
Returns the I/O service that processes I/O operations of this instance.
MAXON_METHOD JobQueueRef GetJobQueue | ( | ) | const |
Returns the job queue that runs completion handlers of this instance.