stream_socket_sendto

Supported Versions: PHP 5, PHP 7, PHP 8
Sends a message to a socket, whether it is connected or not
stream_socket_sendto(    resource $socket,    string $data,    int $flags 0,    string $address ""): int|false
        set_error_handler([self::class, 'nullErrorHandler']);

        try {

            if (-
!== stream_socket_sendto($this->socket$encodedPayload)) {

                return 
true;

            }

            if (!
$socketIsFresh) {
                fclose($this->socket);

                
$this->socket $this->createSocket();

            }

            if (-
!== stream_socket_sendto($this->socket$encodedPayload)) {

                return 
true;

            }

        } finally {