Class: Coolio::Socket
Direct Known Subclasses
Defined Under Namespace
Classes: Connector
Constant Summary
Constants inherited from IO
Class Method Summary collapse
Instance Method Summary collapse
- #attach(evloop) ⇒ Object
-
#initialize(*args) ⇒ Socket
constructor
Just initializes some instance variables to avoid warnings and calls super().
-
#on_connect ⇒ Object
Called upon completion of a socket connection.
-
#on_connect_failed ⇒ Object
(also: #on_resolve_failed)
Called if a socket connection failed to complete.
Methods inherited from IO
#attached?, #close, #closed?, #detach, #disable, #enable, #enabled?, #evloop, #on_close, #on_read, #on_write_complete, #write
Methods included from Meta
#event_callback, #watcher_delegate
Constructor Details
#initialize(*args) ⇒ Socket
Just initializes some instance variables to avoid warnings and calls super().
22 23 24 25 26 |
# File 'lib/cool.io/socket.rb', line 22 def initialize *args @_failed = nil @_connector = nil super end |
Class Method Details
Instance Method Details
#attach(evloop) ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/cool.io/socket.rb', line 31 def attach(evloop) raise RuntimeError, "connection failed" if @_failed if @_connector @_connector.attach(evloop) return self end super end |
#on_connect ⇒ Object
Called upon completion of a socket connection
43 |
# File 'lib/cool.io/socket.rb', line 43 def on_connect; end |
#on_connect_failed ⇒ Object Also known as: on_resolve_failed
Called if a socket connection failed to complete
47 |
# File 'lib/cool.io/socket.rb', line 47 def on_connect_failed; end |