Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem with TCP window size

843790Mar 8 2007 — edited Mar 10 2007
hi.
I am trying to write a program like "iperf" that will be measuring TCP bandwidth performance
and I have a problem with changing TCP window size
Code:
for Client:
  Socket g = new Socket();
  g.setReceiveBufferSize(1472*2); //1472*2 and more  
  g.setSendBufferSize(1472*2);

  g.connect(new InetSocketAddress(ipT, portT));
                
  gniazdo.setReceiveBufferSize(1472*2);
  gniazdo.setSendBufferSize(1472*2);
for Server:
  ServerSocket s = new ServerSocket();
  s.setReceiveBufferSize(1472*2);

  InetSocketAddress serverPort = new InetSocketAddress ( port );

  s.bind(serverPort);
for reading and writing i use:
  DataOutputStream out3 = new DataOutputStream( incoming.getOutputStream()); 
  DataInputStream in3 = new DataInputStream( incoming.getInputStream());
When I check it with
incoming.getReceiveBufferSize(); 
incoming.getSendBufferSize();
I get properly values.
When I sniffs with a windump i get default tcp window size, and speeds are still the same.
Please HELP!


tested on:
windows XP, windows 98 (standard TCP window size)
10Mb LAN

i use:
jdk 1.5.0
jre 1.5.0_09-b03
BlueJ
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2007
Added on Mar 8 2007
5 comments
506 views