[
https://issues.apache.org/jira/browse/DIRMINA-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17084059#comment-17084059
]
Marcin L edited comment on DIRMINA-1123 at 4/15/20, 1:01 PM:
-------------------------------------------------------------
First org.apache.mina.transport.socket.apr.AprSocketAcceptor#open does set the
receive buffer, but NIO acceptor does not. Not sure if this was intentional.
I hope we are talking about the same thing and my understanding of TCP window
scaling is good enough. Please, correct me if I'm wrong.
As far as I understand receive buffer size has the same importance for both
client and server socket. When receive buffer size is not set before connecting
to the endpoint, the operating system will use default maximum window scaling
value during TCP handhake - for example for Windows this is 8 (multiply by
256). This means that this TCP window size which is part of TCP header could
never be increased beyond 256 * 64kb = 16MB.
I tested this on Windows with packet capture and I could confirm that if
receive buffer size is not set on the socket before initial connection this
value can never be higher than the one established during handshake.
It might also be desirable to use smaller window scale value than default max
16MB.
I also found this DIRMINA-561 which claims to set receive buffer size before
calling bind on the server socket, but this is not the case for NIO socket
acceptor.
was (Author: the-thing):
First org.apache.mina.transport.socket.apr.AprSocketAcceptor#open does set the
receive buffer, but NIO acceptor does not. Not sure if this was intentional.
I hope we are talking about the same thing and my understanding of TCP window
scaling is good enough. Please, correct me if I'm wrong.
As far as I understand receive buffer size has the same importance for both
client and server socket. When receive buffer size is not set before connecting
to the endpoint, the operating system will use default maximum window scaling
value during TCP handhake - for example for Windows this is 8 (multiply by
256). This means that this TCP window size which is part of TCP header could
never be increased beyond 256 * 64kb = 16MB.
I tested this on Windows with packet capture and I could confirm that if
receive buffer size is not set on the socket before initial connection this
value can never be higher than the one established during handshake.
It might also be desirable to use smaller window scale value than default max
16MB.
> Receive buffer size is never set for NIO acceptor
> -------------------------------------------------
>
> Key: DIRMINA-1123
> URL: https://issues.apache.org/jira/browse/DIRMINA-1123
> Project: MINA
> Issue Type: Bug
> Components: Transport
> Affects Versions: 2.0.22, 2.1.3
> Reporter: Marcin L
> Priority: Minor
>
> Acceptor window size can't be increased beyond OS defaults.
> It seems the receive buffer size is properly set for
> org.apache.mina.transport.socket.nio.NioSocketConnector, but it is not set at
> all for org.apache.mina.transport.socket.nio.NioSocketAcceptor before socket
> is bound.
> org.apache.mina.core.polling.AbstractPollingIoAcceptor.Acceptor#registerHandles
> comment states that receive buffer size should be initialised, but then
> org.apache.mina.transport.socket.nio.NioSocketAcceptor#open does not do it.,
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]