Class: HandshakeAction

Inherits:
Cramp::Action
  • Object
show all
Defined in:
lib/socket.io/actions/handshake_action.rb

Constant Summary collapse

HEARTBEAT_TIMEOUT =
27
CLOSING_CONNECTION_TIMEOUT =
10
TRANSPORTS =

TRANSPORTS = ‘websocket,xhr-polling,flashsocket’

'websocket'

Instance Method Summary collapse

Instance Method Details

#session_idObject



14
15
16
# File 'lib/socket.io/actions/handshake_action.rb', line 14

def session_id
  uuid.generate
end

#startObject



18
19
20
21
22
# File 'lib/socket.io/actions/handshake_action.rb', line 18

def start
  body = [session_id, HEARTBEAT_TIMEOUT, CLOSING_CONNECTION_TIMEOUT, TRANSPORTS].join(':')
  render body
  finish
end

#uuidObject



10
11
12
# File 'lib/socket.io/actions/handshake_action.rb', line 10

def uuid
  @uuid ||= UUID.new
end