bootstrap.setOption("child.<parameter>", value) vs. bootstrap.setOption("<parameter>", value)

"Trustin Lee (이희승)" trustin at gmail.com
Wed Mar 24 02:27:23 EDT 2010


The option you set for the parent becomes the default value of a new
child.  This is actually exactly same with the behavior of
java.net.ServerSocket.setXXX().

There are only four options available for a server socket by the way:

  * backlog
  * reuseAddress
  * receiveBufferSize
  * performancePreferences

So, setting "tcpNoDelay" for a parent channel will do nothing.

An interesting property is 'receiveBufferSize'.  Simply, you can
associate each option to the call to a ServerSocket or a Socket.

setOption("receiveBufferSize", 1234) means:
        ServerSocket.setReceiveBufferSize(1234)
setOption("child.receiveBufferSize", 1234) means:
        Socket.setReceiveBufferSize(1234)

receiveBufferSize is useful when you want to set the receiveBufferSize
to the value greater than 64K.  Setting 'child.receiveBufferSize' to a
large value will be rejected in some operating systems like Linux.  It
doesn't make a difference if you set 'child.receiveBufferSize' with a
smaller value.

HTH,
Trustin

Squigly wrote:
> I'm sorry, let me rephrase:
> The "father" in itself has no meaning for tcpnodelay or recieveBuffer or
> anything else, as it's not actually representing an active connection, It's
> the child connection that actually uses those parameters, so,
> what exactly would be the diff if I'll set tcpnodelay on the child, and not
> on the father?
> what effect would I have to put X receiveBuffer on the father, and Y on the
> child?

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100324/6d8784fd/attachment-0001.bin 


More information about the netty-users mailing list