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

Brian Burkhalter brian.burkhalter at oracle.com
Fri Jun 12 22:10:31 UTC 2015


On Jun 12, 2015, at 1:01 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:

> On Jun 12, 2015, at 12:59 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
>> This appears to have the same issue. Did you consider passing the address to the Server as part of creating it, ie:
>> 
>> DatagramChannel dc = DatagramChannel.open();
>> dc.bind(new InetSocketAddress(0));
>> Server server = new Server(dc.getLocalAddress());
> 
> I did but however I did it would not work. I’ll try this version.

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. So I propose this version instead:

http://cr.openjdk.java.net/~bpb/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.

Thanks,

Brian 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150612/5d2f787e/attachment.html>


More information about the nio-dev mailing list