Class: NIO::WebSocket::Adapter::Server
- Inherits:
-
NIO::WebSocket::Adapter
- Object
- RawAdapter
- NIO::WebSocket::Adapter
- NIO::WebSocket::Adapter::Server
- Defined in:
- lib/nio/websocket/adapter/server.rb
Instance Attribute Summary
Attributes inherited from NIO::WebSocket::Adapter
Attributes inherited from RawAdapter
#closing, #inner, #monitor, #options
Instance Method Summary collapse
-
#initialize(io, options) ⇒ Server
constructor
A new instance of Server.
Methods inherited from NIO::WebSocket::Adapter
Methods inherited from RawAdapter
#add_to_reactor, #close, #pump_buffer, #read, #teardown, #write
Constructor Details
#initialize(io, options) ⇒ Server
Returns a new instance of Server.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/nio/websocket/adapter/server.rb', line 7 def initialize(io, ) driver = ::WebSocket::Driver.server(self, [:websocket_options] || {}) driver.on :connect do if ::WebSocket::Driver.websocket? driver.env driver.start WebSocket.logger.debug "driver connected" end end super io, driver, end |