Clients -
socket :
UdpClient
Represents UDP socket client and related remote functions.
Constructor
__init
(Address? localAddress, UdpClientConfig? config)
- localAddress Address? ()
-
Locally binding interface and port
- config UdpClientConfig? ()
-
Configure additional details like read timeout etc.
Remote Methods
Send given data to the specified remote client.
Reads data from the remote client. If the data has the specified length, then wait until that number of bytes are received from the client. Else, return the data available in the OS buffer or wait until data receive. If the request length is lesser than the data in the buffer, then the rest will be discarded.
Closes the client socket connection.
Fields
Send given data to the specified remote client.
Reads data from the remote client. If the data has the specified length, then wait until that number of bytes are received from the client. Else, return the data available in the OS buffer or wait until data receive. If the request length is lesser than the data in the buffer, then the rest will be discarded.
Parameters
- length int - -100
-
Positive integer. Represents the number of bytes which should be read
-
Return Type
([byte[], int, Address] | ReadTimedOutError) Content as a byte array, the number of bytes read and the address of the sender or an error if encounters an error while reading