UdpSocket.sendTo

DatagramResult sendTo(scope const(ubyte)[] data, scope const(char)[] host, ushort port) @trusted

Send a datagram to a specific destination.

In WSAPoll mode, data is borrowed directly by the OS sendto call (Borrow semantics). In IOCP overlapped mode, data is copied into an internal buffer (Copy semantics). In both cases the caller may reuse or free the buffer immediately after this call returns.

Parameters

dataDatagram payload to send.
hostDestination host name or IP address.
portDestination port number.

Returns

Result indicating success or failure reason.