public function sendMessage($message, $server, $port, $flags = 0)
    {
        $send = socket_sendto($this->socket, $message, strlen($message), $flags, $server, $port);
        if ($send === false) {
            throw new \RuntimeException('Message could not be sent');
        }

        return $send;
    }
public function sendMessage($message, $server, $port, $flags = 0)
    {
        $send = socket_sendto($this->socket, $message, strlen($message), $flags, $server, $port);
        if ($send === false) {
            throw new \RuntimeException('Message could not be sent');
        }

        return $send;
    }
public function sendMessage ( $ message , $ server , $ port , $ flags = 0 ) { $ send = socket_sendto ( $ this -> socket , $ message , strlen ( $ message ) , $ flags , $ server , $ port ) ; if ( $ send === false ) { throw new \ RuntimeException ( 'Message could not be sent' ) ; } return $ send ; }
Send a message using the socket to a server

@see http://php.net/manual/en/function.socket-sendto.php

@param string $message Message to send
@param string $server  Server ip address
@param int    $port    Server port
@param int    $flags   Option flags

@return int Number of bytes send
@throws \RuntimeException If the message could not be sent
Send a message using the socket to a server