original_string: public function connect(float $connectTimeout = 1.0): Stream
      {
          $errno  = 0;
          $errstr = '';
          $fsockopen = $this->fsockopen;
          $resource = $fsockopen(
                  $this->prefix . $this->host,
                  $this->port,
                  $errno,
                  $errstr,
                  $connectTimeout
          );
          if (false === $resource) {
              throw new ConnectionFailure(
                      'Connect to ' . $this->prefix . $this->host . ':'. $this->port
                      . ' within ' . $connectTimeout . ' second'
                      . (1 == $connectTimeout ? '' : 's') . ' failed: '
                      . $errstr . ' (' . $errno . ').'
              );
          }
  
          return new Stream($resource, $this->usesSsl());
      }
code: public function connect(float $connectTimeout = 1.0): Stream
      {
          $errno  = 0;
          $errstr = '';
          $fsockopen = $this->fsockopen;
          $resource = $fsockopen(
                  $this->prefix . $this->host,
                  $this->port,
                  $errno,
                  $errstr,
                  $connectTimeout
          );
          if (false === $resource) {
              throw new ConnectionFailure(
                      'Connect to ' . $this->prefix . $this->host . ':'. $this->port
                      . ' within ' . $connectTimeout . ' second'
                      . (1 == $connectTimeout ? '' : 's') . ' failed: '
                      . $errstr . ' (' . $errno . ').'
              );
          }
  
          return new Stream($resource, $this->usesSsl());
      }
code_tokens: public function connect ( float $ connectTimeout = 1.0 ) : Stream { $ errno = 0 ; $ errstr = '' ; $ fsockopen = $ this -> fsockopen ; $ resource = $ fsockopen ( $ this -> prefix . $ this -> host , $ this -> port , $ errno , $ errstr , $ connectTimeout ) ; if ( false === $ resource ) { throw new ConnectionFailure ( 'Connect to ' . $ this -> prefix . $ this -> host . ':' . $ this -> port . ' within ' . $ connectTimeout . ' second' . ( 1 == $ connectTimeout ? '' : 's' ) . ' failed: ' . $ errstr . ' (' . $ errno . ').' ) ; } return new Stream ( $ resource , $ this -> usesSsl ( ) ) ; }
docstring: opens a connection to host
  
  @param   float  $connectTimeout  optional timeout for establishing the connection, defaults to 1 second
  @return  \stubbles\peer\Stream
  @throws  \stubbles\peer\ConnectionFailure
docstring_tokens: opens a connection to host