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:----OYTy57RQl+UFdXpYV0lZbUT8SJdXWbpiEhvyEOYso/QqRaVz6d8XW9ZICJb0FVq0C3rXIPxtwB0T1jf1S+yn21/9UjW2XBjIPbPKWCsBdUyOn6HJAFCnwhvJgPZpx5I1Yxvx7K+aLaJ90m6/80cpKvOaVFHEDlw6wap669AwpQKVuYQcd9ErrKYnTr31p/3FY0c//YJ0MOSQ5Lj2dKvIsUQULd3Rr5J0J9eWGfQGtvu2a918r9C53V75Dcbhb3AKBnE8xbbHH8c5+sRW3dtd+4E94jLqp5Quqy5FC7DpVGEOQxGg9sXIMY5O251LIvZ4r5o/KrAIiOIQLhPJRnGEMBa8VgC5kW3oIzUcDUtK2nT+oI1MshlsQZLbBdK2crhf48ic83Z1DqEnV/5Wq9xgJatXZymZvUdixYElwXFQFuolRy6olU9C5M7VWRfgXO1HUi5tNx7Am0MBYJh6b4DqmeQ+jmOLdqlulfa+Cd0bC3BXhe7XQvPw1pdFC3k3nZsPrIq0JaouZCPG4pfE0jwdNEDuKErD2icHgUy+DMD5MshnFKk16FIOyXF/+fYzyVecYASxzt2ucuOXt/HyLg2G1s3jHovghI5yJ/3Km/MVMKxnCNiS4rkKz9/+lplJtDxzdtvL9YmBuL0GTtTfC9yih3oUcXZzfZLnLZMZ8OQt1TM=----ATTACHMENT:----OTU5MzAzMDU0MDI5NzQyMCA1MDA5OTkyNzU1MTI0NjkxIDg0MDY3MzM1MjczNjYzMTg=