fun tryReceive(dst: ByteBuffer): SocketAddress?
(source)
Receives a datagram via this channel, if one is immediately available.
dst
- The buffer into which the datagram is to be transferred.
ClosedChannelException
- If the channel is closed.
AsynchronousCloseException
- If another thread closes this channel while the receive operation is in
progress.
ClosedByInterruptException
- If another thread interrupts the current thread while the receive operation is
in progress, thereby closing the channel and setting the current thread's interrupt status.
IOException
- If some other I/O error occurs.
Return
The datagram's source address, or null
if no datagram was available to be received.