Latency

javac myluck at gmail.com
Fri Aug 6 21:26:22 EDT 2010


Can somebody please help me. I am having some latency issues with Netty and
cannot figure it out why.

I am sending two message by the following method at the same time.
public void sendToClient(Object message) throws DispatchException {
		if(channel.isConnected() && !terminate) {
			System.out.println("Sending message to client");
			channel.write(message);
			return;
		}
		throw new DispatchException("Channel not connected.");
	}
Message is received on client as follow
public final class APIClientIOHandler extends SimpleChannelUpstreamHandler {
.......
 public void messageReceived(ChannelHandlerContext ctx, final MessageEvent
e) {
        APIResponse response = (APIResponse) e.getMessage();
        System.out.println("On Msg="+System.nanoTime());

The first message arrives properly in reasonable amount of time in few ms.
The second message arrives after about 200ms. Can somebody please help me
and suggest what might be wrong. Please let me know if you need more info.

Here is the output. Time is in nanosecond.
$$$$$$$Connection=CONNECTED
on Start=323289207197900
On Msg=323289211803125
On Msg=323289414574357
$$$$$$$$Connection=DISCONNECTED

Chris
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Latency-tp5382779p5382779.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list