Ignore:
Timestamp:
Jul 24, 2008, 8:58:58 PM (13 years ago)
Author:
charles
Message:

one more piece of Aloisius' performance patch: set SO_SNDBUF to 2x MTU

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r6334 r6396  
    116116createSocket( int type, int priority )
    117117{
    118     return makeSocketNonBlocking( tr_fdSocketCreate( type, priority ) );
     118    int fd;
     119
     120    fd = tr_fdSocketCreate( type, priority );
     121
     122    if( fd >= 0 )
     123        fd = makeSocketNonBlocking( fd );
     124
     125    if( fd >= 0 ) {
     126        const int buffsize = 1500*2; /* 2x MTU for most ethernet/wireless */
     127        setsockopt( fd, SOL_SOCKET, SO_SNDBUF, &buffsize, sizeof( buffsize ) );
     128    }
     129
     130    return fd;
    119131}
    120132
Note: See TracChangeset for help on using the changeset viewer.