Class: Appril::RTCPController

Inherits:
BaseController show all
Defined in:
lib/appril/rtcp_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseController

#rtcp?

Instance Attribute Details

#socketObject (readonly)

Returns the value of attribute socket.



3
4
5
# File 'lib/appril/rtcp_controller.rb', line 3

def socket
  @socket
end

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/appril/rtcp_controller.rb', line 5

def index
  return unless websocket?

  @socket = Tubesock.hijack(env)
  @socket.onopen(&method(:on_open))
  @socket.onmessage(&method(:on_message))
  @socket.onclose(&method(:on_close))
  @socket.listen

  halt websocket_response
end