X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconnection.cpp;h=4867cc55b36fb9f306aa79a64e99424c75e359d3;hb=afb129a6421a7b07a21d845c50065b3c1bb49510;hp=9ee559725611f7b6fe30c5ad7066f64c6b21d329;hpb=2f289f057ddfd61b7c5c00f7e292b0a72f10c80c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/connection.cpp b/src/connection.cpp index 9ee559725..4867cc55b 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -70,10 +70,17 @@ bool connection::CreateListener(char* host, int p) this->port = p; - setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(const char*)&on,sizeof(on)); - linger.l_onoff = 1; - linger.l_linger = 0; - setsockopt(fd,SOL_SOCKET,SO_LINGER,(const char*)&linger,sizeof(linger)); + setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(const char*)&on,sizeof(on)); + linger.l_onoff = 1; + linger.l_linger = 0; + setsockopt(fd,SOL_SOCKET,SO_LINGER,(const char*)&linger,sizeof(linger)); + + // attempt to increase socket sendq and recvq as high as its possible + // to get them on linux. + int sendbuf = 32768; + int recvbuf = 32768; + setsockopt(fd,SOL_SOCKET,SO_SNDBUF,(const void *)&sendbuf,sizeof(sendbuf)); + setsockopt(fd,SOL_SOCKET,SO_RCVBUF,(const void *)&recvbuf,sizeof(sendbuf)); return true; }