Method: SocketIO::Client#initialize
- Defined in:
- lib/SocketIO.rb
#initialize(uri, session_id, heartbeat_timeout, connection_timeout, supported_transports, options = {}) ⇒ Client
The state of the Socket.IO socket can be disconnected, disconnecting, connected and connecting. The transport connection can be closed, closing, open, and opening.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/SocketIO.rb', line 34 def initialize(uri, session_id, heartbeat_timeout, connection_timeout, supported_transports, = {}) @uri = uri namespace = uri.path.sub(%r~^/~, '') @namespace = namespace.empty? ? "socket.io" : namespace @session_id = session_id @hb_timeout = heartbeat_timeout @connect_timeout = connection_timeout @supported_transports = supported_transports @options = @reconnect = [:reconnect] @on_event = {} end |