increase the socket's SNDBUF size

This commit is contained in:
Charles Kerr 2008-11-16 21:16:14 +00:00
parent 1619652997
commit 93b3dc5617
1 changed files with 8 additions and 1 deletions

View File

@ -119,7 +119,14 @@ makeSocketNonBlocking( int fd )
static int
createSocket( int type )
{
return makeSocketNonBlocking( tr_fdSocketCreate( type ) );
const int fd = makeSocketNonBlocking( tr_fdSocketCreate( type ) );
if( fd >= 0 ) {
const int buffsize = 1500*3; /* 3x MTU for most ethernet/wireless */
setsockopt( fd, SOL_SOCKET, SO_SNDBUF, &buffsize, sizeof( buffsize ) );
}
return fd;
}
int