1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-09-01 17:12:41 +02:00

Change protocol

This commit is contained in:
Kim Pepper
2020-08-14 10:29:13 +10:00
parent bf1a76edb4
commit 1eaf4c2bf5

View File

@@ -28,8 +28,14 @@ class UdpSocket
{ {
$this->ip = $ip; $this->ip = $ip;
$this->port = $port; $this->port = $port;
$domain = $port === 0 ? AF_UNIX : AF_INET; $domain = AF_INET;
$this->socket = socket_create($domain, SOCK_DGRAM, SOL_UDP); $protocol = SOL_UDP;
// Check if we are using unix sockets.
if ($port === 0) {
$domain = AF_UNIX;
$protocol = IPPROTO_IP;
}
$this->socket = socket_create($domain, SOCK_DGRAM, $protocol);
} }
public function write($line, $header = "") public function write($line, $header = "")