dev@grizzly.java.net

Context#write vs. Connection.write

From: Tigran Mkrtchyan <tigran.mkrtchyan_at_desy.de>
Date: Fri, 22 Feb 2013 11:22:19 +0100

Hi,

I have in the code following lines:

   context.write(context.getAddress(), buffer, null);

is it safe to replace with:

 connection = context.getConnection();
 remoteAddress = (InetSocketAddress)context.getAddress();

 connection.write(remoteAddress, buffer, null);

The main difference is that point where I use connection is much later
and executed by other thread ( e.q. I am building in async reply
mechanism).

Well, it works but I want to be sure that it's reliable.

Thanks,
   Tigran.