Client.php
public function connect(){
        $this->stream = stream_socket_client('tcp://'.$this->host.':'.$this->port, $errno, $errstr, 10);
        if(!$this->stream){
            throw new Exception("Error $errno : $errstr");
        }

        return fgets($this->stream);
    }
public function connect(){
        $this->stream = stream_socket_client('tcp://'.$this->host.':'.$this->port, $errno, $errstr, 10);
        if(!$this->stream){
            throw new Exception("Error $errno : $errstr");
        }

        return fgets($this->stream);
    }
Connect to the service
@return string service informations json_decoded
@throws Exception