Class: Finlight::BaseWebSocketClient::DriverSocket

Inherits:
Object
  • Object
show all
Defined in:
lib/finlight/websocket/base_client.rb

Overview

Adapter between websocket-driver and the raw socket.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, io) ⇒ DriverSocket

Returns a new instance of DriverSocket.



37
38
39
40
# File 'lib/finlight/websocket/base_client.rb', line 37

def initialize(url, io)
  @url = url
  @io = io
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



35
36
37
# File 'lib/finlight/websocket/base_client.rb', line 35

def url
  @url
end

Instance Method Details

#write(data) ⇒ Object



42
43
44
45
46
# File 'lib/finlight/websocket/base_client.rb', line 42

def write(data)
  @io.write(data)
rescue StandardError
  # The connection is going down; the read loop notices independently.
end