[9] RFR of 8087304: (ch) java/nio/channels/DatagramChannel/EmptyBuffer.java received 4 times while expected 3

Alan Bateman 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 
Server thread.

> So I propose this version instead:
> http://cr.openjdk.java.net/~bpb/8087304/webrev.01/ 
> <http://cr.openjdk.java.net/%7Ebpb/8087304/webrev.01/>
> 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...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150614/6d2f2621/attachment.html>

More information about the nio-dev mailing list