function close()
    {
        if(!$this->socket) {
            return;
        }

        $this->sendDisconnect();
        stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
        $this->socket = null;
    }
function close()
    {
        if(!$this->socket) {
            return;
        }

        $this->sendDisconnect();
        stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
        $this->socket = null;
    }
function close ( ) { if ( ! $ this -> socket ) { return ; } $ this -> sendDisconnect ( ) ; stream_socket_shutdown ( $ this -> socket , STREAM_SHUT_RDWR ) ; $ this -> socket = null ; }
Closes connection to server by first sending DISCONNECT packet, and
then closing the stream socket
Closes connection to server by first sending DISCONNECT packet and then closing the stream socket