I recently found code using
DatagramChannel.write(). The code only asked for host ip and port before it connected and then would allow sending (via
Being new to network programming, it seemed odd that it wouldn't request the destination IP/port. Why not?
Oracle's documentation states
This method may only be invoked if this channel's socket is connected, in which case it sends datagrams directly to the socket's peer.
What does it mean by "the socket's peer"?