Increased UDP buffer size

This commit is contained in:
kotyaralih 2021-12-05 08:39:53 -08:00
parent 413f381dcc
commit c81a9dc7a6
2 changed files with 4 additions and 4 deletions

View file

@ -34,8 +34,8 @@ class UDPSocket{
}else{
if(socket_bind($this->sock, $serverip, $port) === true){
socket_set_option($this->sock, SOL_SOCKET, SO_REUSEADDR, 0);
socket_set_option($this->sock, SOL_SOCKET, SO_SNDBUF, 65535);
socket_set_option($this->sock, SOL_SOCKET, SO_RCVBUF, 65535);
socket_set_option($this->sock, SOL_SOCKET, SO_SNDBUF, 1024 * 1024 * 8); //8MB
socket_set_option($this->sock, SOL_SOCKET, SO_RCVBUF, 1024 * 1024); //1MB
$this->unblock();
$this->connected = true;
}else{