Class: Kosmonaut::Socket
- Inherits:
-
Object
- Object
- Kosmonaut::Socket
- Defined in:
- lib/kosmonaut/socket.rb
Overview
Internal: Socket is a base class defining tools and helpers used by Client and Worker implementations.
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Public: A parsed URL of the WebRocket backend endpoint.
Instance Method Summary collapse
-
#initialize(url) ⇒ Socket
constructor
Internal: The Socket constructor.
Constructor Details
#initialize(url) ⇒ Socket
Internal: The Socket constructor.
The endpoint’s URL must have the following format:
[scheme]://[secret]@[host]:[port]/[vhost]
28 29 30 31 |
# File 'lib/kosmonaut/socket.rb', line 28 def initialize(url) @uri = URI.parse(url) @addr = ::Socket.getaddrinfo(@uri.host, nil) end |
Instance Attribute Details
#uri ⇒ Object (readonly)
Public: A parsed URL of the WebRocket backend endpoint.
20 21 22 |
# File 'lib/kosmonaut/socket.rb', line 20 def uri @uri end |