This commit is contained in:
Hiroki Noda 2018-03-22 05:16:36 +09:00
parent d3708c5e66
commit e68f1425a9

View file

@ -955,14 +955,15 @@ private int getSocketError()
version (Windows) return WSAGetLastError();
else return errno;
}
private int getBacklogSize()
@trusted @nogc nothrow {
int backlog = 128;
version(linux)
version (linux)
{
import core.stdc.stdio : fclose, fopen, fscanf;
auto somaxconn = fopen("/proc/sys/net/core/somaxconn", "re");
if(somaxconn)
if (somaxconn)
{
int tmp;
if (fscanf(somaxconn, "%d", &tmp) == 1)