RCON: Explicitly specify connection backlog size, fixes #2685

I believe this is caused by a bug in the linux kernel, since it only impacts certain machines I tested (one, to be specific). Whatever the case, setting a max backlog size is prudent anyway, and fixes the problem.
This commit is contained in:
Dylan K. Taylor 2019-01-22 22:11:32 +00:00
parent feaaa925a7
commit 45a4252c26

View File

@ -74,7 +74,7 @@ class RCON{
$this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if($this->socket === false or !@socket_bind($this->socket, $interface, $port) or !@socket_listen($this->socket)){ if($this->socket === false or !@socket_bind($this->socket, $interface, $port) or !@socket_listen($this->socket, 5)){
throw new \RuntimeException(trim(socket_strerror(socket_last_error()))); throw new \RuntimeException(trim(socket_strerror(socket_last_error())));
} }