From: Nicola B. <nb...@es...> - 2005-07-20 16:51:16
|
On Tuesday 19 Jul 2005 16:06, Brian Gerkey wrote: > > You can change the size of those buffers with setsockopt(). Check > the man page for details. You would use the SO_SNDBUF and SO_RCVBUF > options to change the size of the send and receive buffers, > respectively. I would try increasing the server's send buffer and > the client's receive buffer. I don't know whether the OS puts a hard > limit on the size of those buffers. You can put the call to > setsockopt() pretty much anywhere after the socket has been created > at each end. Let me know if and how well that works. Well spotted Brian, I've followed your suggestions and the warning disappeared :) Here's the code I've inserted in "server/clientmanager.cc", line 446 (please forgive the ugly code, I just took some examples of setsockopt/getsockopt I found online...): ----- int bufSize = 1024 * 256; if (setsockopt(clientData->socket, SOL_SOCKET, SO_SNDBUF, (char *)&bufSize, (int)sizeof(bufSize)) != 0) { fprintf(stderr, "Error calling setsockopt\n"); exit(-1); } int sndSize = 0; int size = sizeof(int); if (getsockopt(clientData->socket, SOL_SOCKET, SO_SNDBUF, (char *)&sndSize, (socklen_t*)&size) != 0) { fprintf(stderr, "Error calling getsockopt\n"); exit(-1); } else fprintf(stderr, "Send buffer size: %d\n", sndSize); ----- I did the same on the client side, increasing the input buffer of "PlayerClient::conn.socket" with the option SO_RCVBUF. Everything seems to work fine now. Thanks Nicola -- ------------------------------------------ Nicola Bellotto University of Essex Department of Computer Science Wivenhoe Park Colchester CO4 3SQ United Kingdom Room: 1N1.2.8 Tel. +44 (0)1206 874094 E-Mail: nb...@es... URL: http://privatewww.essex.ac.uk/~nbello ------------------------------------------ |