469,622 Members | 2,170 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,622 developers. It's quick & easy.


I have written a simple TCP client/server. I would like to change the TCP
receive buffer on the server side, to see performance differences. I am

err = sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 4096)

but that doesn't seem to actual change the buffer size.

The code is:

#Create a socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

#Ensure that you can restart your server quickly when it terminates

sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

#Set the Recieve Buffer Size

err = sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 4096)

print socket.SO_RCVBUF

#Set the client socket's TCP port number

sock.bind(('', portno))

Development is being done a Gentoo Linux box.

Any suggestions would be great!


Jul 19 '05 #1
0 2383

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Tero Saarni | last post: by
1 post views Thread by Dmitry Akselrod | last post: by
3 posts views Thread by Terry Sanders | last post: by
3 posts views Thread by Michael Maercker | last post: by
reply views Thread by obarrientos | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.