Name: ddT132432 Date: 11/20/2001
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
See W.R. Stevens, Unix Network Programming, 2nd edition, Vol 1 p 192: "when
setting the size of the TCP socket receive buffer, the ordering of the function
calls is important."
For optimum connection performance, socket buffer sizes for a server-side socket
should be set on the listening socket and inherited by the accepted socket
*before* it has been accepted. Otherwise the new buffer size isn't used when
negotiating the window scale, which only occurs during the connect sequence, so
the benefit of having a large buffer (>64k) is invisible to the other end - not
perceived as the true window size.
Therefore the client-side TCP sends data in accordance with a smaller perceived
target window size than is really the case. This unnecessarily limits the
overall performance of the connection, i.e. limits the true usefulness of the
Socket.set{Send,Receive}BufferSize methods. To overcome this limitation, the
same buffersize-setting methods are needed in ServerSocket.
(Review ID: 136040)
======================================================================
- duplicates
-
JDK-4397070 Socket.setSendBufferSize and setReceiveBufferSize do not properly delegate to OS
- Resolved