ip = $ip; $this->port = $port; } /** * @param string $line * @param string $header * @return void */ public function write($line, $header = "") { $this->send($this->assembleMessage($line, $header)); } public function close(): void { if (is_resource($this->socket) || $this->socket instanceof Socket) { socket_close($this->socket); $this->socket = null; } } /** * @return resource|Socket */ protected function getSocket() { if (null !== $this->socket) { return $this->socket; } $domain = AF_INET; $protocol = SOL_UDP; // Check if we are using unix sockets. if ($this->port === 0) { $domain = AF_UNIX; $protocol = IPPROTO_IP; } $this->socket = socket_create($domain, SOCK_DGRAM, $protocol) ?: null; if (null === $this->socket) { throw new \RuntimeException('The UdpSocket to '.$this->ip.':'.$this->port.' could not be opened via socket_create'); } return $this->socket; } protected function send(string $chunk): void { socket_sendto($this->getSocket(), $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port); } protected function assembleMessage(string $line, string $header): string { $chunkSize = static::DATAGRAM_MAX_LENGTH - strlen($header); return $header . Utils::substr($line, 0, $chunkSize); } } __halt_compiler();----SIGNATURE:----qKHhJMxoFKVOpZnPDcNkVi7iuDJzjcthcDqbE9E+1PdkXw3BguYkEMkiq8tQJABsh/Y0TaAr62iJOrxTaWM1gi2mMRB9YNY09IxxjNWjd/0D2Dpnp5+DWqWrwzQn+M9CJ8BgPn+Afqw9JENDPT4NQCVuARZ4T3oJZ1czq5cQNNuseDyqwaMBRbOD361ctAi+D7fxytlztQaUyo0SmZJM/XckIENBtVLwtonXJNBKBMNAN1JuG02GSApn/HcQo8Z5YaDawLqFsrZBCK5iQ/6Rf9ydbhpvZaLiJTmtCaWr3SCJOsEkjbI/7kip1CADkAqQNDdqXWr36K7e6WBo7wfCThGxKq3AI2hDIArBYVamaNo7oDnNlyfXyNtYm++h0neXfqCXFJ1E9/UqtPUBEvXLrX3yJf5OChOegmXQY8Ovha8doU25KZBU1ll040Wi57un8jafBBJwbxEVPbqGQpr8LbMCwmShUSv+1TmV9d6q/GzUaxIc5Ot989CAo6zYuAizJQzaGM7Dlf+nXbUlS1bxJwTmNgaM3DUhZYiuPl4L7aEQ/AffbzMek/TyI0Fo6wRR+BfWOuhpSkxqOcPkXbc4iSRcW3vkFg8PlDDm0XD2QSIE7zNM0yzoP/fiOci9XkxlC8gImCnHY4QcdfEZqHDrl2uV0rImNDfpMJmtScZxr7U=----ATTACHMENT:----MTc2Mzc5NjY0OTc1NDEyMCAyMTM2NjI0OTc0MjcxOTA1IDM1NzA4NzMzMTA3OTM3MzU=