Class: NIO::WebSocket::Adapter::Client

Inherits:
NIO::WebSocket::Adapter show all
Defined in:
lib/nio/websocket/adapter/client.rb

Instance Attribute Summary collapse

Attributes inherited from NIO::WebSocket::Adapter

#driver

Attributes inherited from RawAdapter

#closing, #inner, #monitor, #options

Instance Method Summary collapse

Methods inherited from NIO::WebSocket::Adapter

#close, #read, #teardown

Methods inherited from RawAdapter

#add_to_reactor, #close, #pump_buffer, #read, #teardown, #write

Constructor Details

#initialize(url, io, options) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
12
13
# File 'lib/nio/websocket/adapter/client.rb', line 7

def initialize(url, io, options)
  @url = url
  driver = ::WebSocket::Driver.client(self, options[:websocket_options] || {})
  super io, driver, options
  WebSocket.logger.debug "Initiating handshake on #{io}"
  driver.start
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



14
15
16
# File 'lib/nio/websocket/adapter/client.rb', line 14

def url
  @url
end