public function onMessage(string $message, string $address, SocketInterface $socket)
    {
        try {
            $this->dispatch(Events::MESSAGE, new MessageEvent($socket, $address, $message));
            $socket->send($this->handleQueryFromStream($message), $address);
        } catch (\Exception $exception) {
            $this->dispatch(Events::SERVER_EXCEPTION, new ServerExceptionEvent($exception));
        }
    }
public function onMessage(string $message, string $address, SocketInterface $socket)
    {
        try {
            $this->dispatch(Events::MESSAGE, new MessageEvent($socket, $address, $message));
            $socket->send($this->handleQueryFromStream($message), $address);
        } catch (\Exception $exception) {
            $this->dispatch(Events::SERVER_EXCEPTION, new ServerExceptionEvent($exception));
        }
    }
public function onMessage ( string $ message , string $ address , SocketInterface $ socket ) { try { $ this -> dispatch ( Events :: MESSAGE , new MessageEvent ( $ socket , $ address , $ message ) ) ; $ socket -> send ( $ this -> handleQueryFromStream ( $ message ) , $ address ) ; } catch ( \ Exception $ exception ) { $ this -> dispatch ( Events :: SERVER_EXCEPTION , new ServerExceptionEvent ( $ exception ) ) ; } }
This methods gets called each time a query is received.

@param string          $message
@param string          $address
@param SocketInterface $socket
This methods gets called each time a query is received .