From: <bc...@us...> - 2007-12-12 22:19:41
|
Revision: 1307 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1307&view=rev Author: bcholew Date: 2007-12-12 14:19:44 -0800 (Wed, 12 Dec 2007) Log Message: ----------- Decrease socket buffer size from 256KB to 128KB. That seems like enough. Help avoid packet loss by increasing socket's output buffer to the same size as it's input buffer. Modified Paths: -------------- trunk/lib/libiax2/src/iax.c Modified: trunk/lib/libiax2/src/iax.c =================================================================== --- trunk/lib/libiax2/src/iax.c 2007-12-12 22:13:49 UTC (rev 1306) +++ trunk/lib/libiax2/src/iax.c 2007-12-12 22:19:44 UTC (rev 1307) @@ -899,7 +899,7 @@ struct sockaddr_in sin; socklen_t sinlen; int flags; - int bufsize = 256 * 1024; + int bufsize = 128 * 1024; if (netfd > -1) { @@ -989,10 +989,18 @@ if (setsockopt(netfd, SOL_SOCKET, SO_RCVBUF, (char *)&bufsize, sizeof(bufsize)) < 0) { - DEBU(G "Unable to set buffer size."); - IAXERROR "Unable to set buffer size."); + DEBU(G "Unable to set receive buffer size."); + IAXERROR "Unable to set receive buffer size."); } + /* set send buffer size too */ + if (setsockopt(netfd, SOL_SOCKET, SO_SNDBUF, (char *)&bufsize, + sizeof(bufsize)) < 0) + { + DEBU(G "Unable to set send buffer size."); + IAXERROR "Unable to set send buffer size."); + } + portno = ntohs(sin.sin_port); DEBU(G "Started on port %d\n", portno); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |