RFR of 8087304: (ch) java/nio/channels/DatagramChannel/EmptyBuffer.java received 4 times while expected 3
Alan.Bateman at oracle.com
Sun Jun 14 06:14:38 UTC 2015
On 12/06/2015 23:10, Brian Burkhalter wrote:
> OK, I retried the above approach but did not see how to get it to
> work. It seemed a conundrum: I could not get the client address needed
> in the server without first connecting the client to the server which
> requires knowing the server port.
It connects to the host address (or whatever address that
InetAddress.getLocalHost returns) so if you also bind to the host
address then it means you have the host + port before you create the
> So I propose this version instead:
> In this version the client address is set on the Server instance in
> the main thread before the server thread is started.
This version is okay. It relies on the Thread.start but that is okay if
you don't want to put any more time into this one.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nio-dev