1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-31 00:40:15 +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->port = $port;
$domain = $port === 0 ? AF_UNIX : AF_INET;
$this->socket = socket_create($domain, SOCK_DGRAM, SOL_UDP);
$domain = AF_INET;
$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 = "")