Module: OrientDbClient

Defined in:
lib/orient_db_client.rb,
lib/orient_db_client/rid.rb,
lib/orient_db_client/types.rb,
lib/orient_db_client/session.rb,
lib/orient_db_client/version.rb,
lib/orient_db_client/connection.rb,
lib/orient_db_client/exceptions.rb,
lib/orient_db_client/server_session.rb,
lib/orient_db_client/network_message.rb,
lib/orient_db_client/database_session.rb,
lib/orient_db_client/protocol_factory.rb,
lib/orient_db_client/protocols/protocol7.rb,
lib/orient_db_client/protocols/protocol9.rb,
lib/orient_db_client/serializers/serializer7.rb,
lib/orient_db_client/deserializers/deserializer7.rb

Defined Under Namespace

Modules: Deserializers, Protocols, Serializers, Types Classes: Connection, DatabaseSession, NetworkMessage, ProtocolError, ProtocolFactory, RecordNotFound, Rid, ServerSession, Session, UnsupportedProtocolError

Constant Summary collapse

VERSION =
"0.0.6"

Class Method Summary collapse

Class Method Details

.connect(host, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/orient_db_client.rb', line 8

def connect(host, options = {})
   options[:port] = options[:port].to_i
   options[:port] = 2424 if options[:port] == 0

	s = TCPSocket.open(host, options[:port])

   protocol = BinData::Int16be.read(s)

	Connection.new(s, options[:protocol] || protocol)
end