I am trying to understand netty and it's relationship with TCP Flow control 
(since it has non-blocking I/O).
Also, I am trying to understand, outbound channel buffer's use and 
watermarks. How does it come into play if I only use WriteandFlush().

As a test case, I have a netty server which writes to a client, the client 
is blocked (essentially has a sleep of 10 seconds between each read)

- Under normal I/O TCP sender would be throttled (sending is slowed down 
because of flow control) if the receiver is blocked, this is not the case 
here. The sender seems to keep writing and flushing data on each send. 
Where is this data being written? Is there going to be Flow control in the 
netty's flush() as well? 
See: 
https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Flow_control

- Is it is being written to an OS or TCP buffer, does netty channel have an 
internal buffer as well? If so how can I configure it?

- I track bytesBeforeUnwritable but they do not seem to be decreasing even 
after sending a lot of data. (I only use writeandflush() )

- What is the default High and Low Watermark? I have not set anything in my 
application. Is there any way to use this instead?


Code below:

     @Override
        public void channelRead(final ChannelHandlerContext ctx, Object buf) 
{
    if (server3OutboundChannel.isActive()) {
                server3OutboundChannel.writeAndFlush(msg)
                        .addListener(new ChannelFutureListener() {
                    @Override
                    public void operationComplete(ChannelFuture future) {
                        if (future.isSuccess()) {
                            // was able to flush out data, start to read 
the next chunk
                            System.out.println(server3OutboundChannel.
bytesBeforeUnwritable());
                            ctx.channel().read();
                        } else {
                            future.channel().close();
                        }
                    }
                });
            }
    }


Could anyone please let me know?

Thanks
Nipun

-- 
You received this message because you are subscribed to the Google Groups 
"Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/netty/335cadcd-0db4-4b9a-ae62-863318284dbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to