def connect
      @socket = TCPSocket.open(@options[:host], @options[:port])
      @server_protocol_version = BinData::Int16be.read(socket)

      # minimal protocol version we are supporting is 19
      raise ProtocolVersionError, "Protocols 19 and above are supported. Please upgrade your OrientDb server." if @server_protocol_version < 19

      server_protocol_string = "OrientdbBinary::Protocol::Protocol#{@server_protocol_version}"
      constant = Object.const_defined?(server_protocol_string) ? Object.const_get(server_protocol_string) : OrientdbBinary::Protocol::Protocol19
      @protocol = constant
    end
def connect
      @socket = TCPSocket.open(@options[:host], @options[:port])
      @server_protocol_version = BinData::Int16be.read(socket)

      # minimal protocol version we are supporting is 19
      raise ProtocolVersionError, "Protocols 19 and above are supported. Please upgrade your OrientDb server." if @server_protocol_version < 19

      server_protocol_string = "OrientdbBinary::Protocol::Protocol#{@server_protocol_version}"
      constant = Object.const_defined?(server_protocol_string) ? Object.const_get(server_protocol_string) : OrientdbBinary::Protocol::Protocol19
      @protocol = constant
    end
Initializes connection

 @param [Hash] options

 @option [String, Symbol] host Host name
 @option [String, Symbol] port Port number

 @since 1.0
 Establishes connection with OrientDb Socket

 @since 1.0