Sockets SO_RCVBUF

J

Josh

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
trying



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!



-Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,787
Messages
2,569,629
Members
45,332
Latest member
LeesaButts

Latest Threads

Top