final public function close()
    {

        $this->onCloseConnection();

        if($this->socket){
            $this->write("</stream:stream>");
            parent::close();
            $this->connected = false;
        }

    }
final public function close()
    {

        $this->onCloseConnection();

        if($this->socket){
            $this->write("</stream:stream>");
            parent::close();
            $this->connected = false;
        }

    }
final public function close ( ) { $ this -> onCloseConnection ( ) ; if ( $ this -> socket ) { $ this -> write ( "</stream:stream>" ) ; parent :: close ( ) ; $ this -> connected = false ; } }
Ends the stream and closes the connection
Ends the stream and closes the connection