original_string: public function exec()
      {
          $this->response = '';
          $errno = $errstr = null;
  
          if (isset($this->context)) {
              $this->stream = stream_socket_client($this->socket, $errno, $errstr, $this->timeout, STREAM_CLIENT_CONNECT, $this->context);
          } else {
              $this->stream = stream_socket_client($this->socket, $errno, $errstr, $this->timeout);
          }
  
          if (!empty($errstr)) {
              throw new UnexpectedValueException($errstr);
          }
  
          fwrite($this->stream, $this->getRequestBody());
  
          while (!feof($this->stream)) {
              $this->response .= fgets($this->stream, 1024);
          }
  
          fclose($this->stream);
          $this->stream = null;
  
          return $this;
      }
code: public function exec()
      {
          $this->response = '';
          $errno = $errstr = null;
  
          if (isset($this->context)) {
              $this->stream = stream_socket_client($this->socket, $errno, $errstr, $this->timeout, STREAM_CLIENT_CONNECT, $this->context);
          } else {
              $this->stream = stream_socket_client($this->socket, $errno, $errstr, $this->timeout);
          }
  
          if (!empty($errstr)) {
              throw new UnexpectedValueException($errstr);
          }
  
          fwrite($this->stream, $this->getRequestBody());
  
          while (!feof($this->stream)) {
              $this->response .= fgets($this->stream, 1024);
          }
  
          fclose($this->stream);
          $this->stream = null;
  
          return $this;
      }
code_tokens: public function exec ( ) { $ this -> response = '' ; $ errno = $ errstr = null ; if ( isset ( $ this -> context ) ) { $ this -> stream = stream_socket_client ( $ this -> socket , $ errno , $ errstr , $ this -> timeout , STREAM_CLIENT_CONNECT , $ this -> context ) ; } else { $ this -> stream = stream_socket_client ( $ this -> socket , $ errno , $ errstr , $ this -> timeout ) ; } if ( ! empty ( $ errstr ) ) { throw new UnexpectedValueException ( $ errstr ) ; } fwrite ( $ this -> stream , $ this -> getRequestBody ( ) ) ; while ( ! feof ( $ this -> stream ) ) { $ this -> response .= fgets ( $ this -> stream , 1024 ) ; } fclose ( $ this -> stream ) ; $ this -> stream = null ; return $ this ; }
docstring: Open Internet or Unix domain socket connection and execute a query
  @throws UnexpectedValueException
  @return $this
docstring_tokens: Open Internet or Unix domain socket connection and execute a query