socket
method of this class can return the related DatagramSocket
instance, which can handle the socket. A datagram channel is open but not connected when created by open
method. After connected, it will keep the connected status before disconnecting or closing. The benefit of a connected channel is the reduced effort of security checks during send and receive. When invoking read
or write
, a connected channel is required.
Datagram channels are thread-safe, no more than one thread can read or write at given time.
|
|
|
|