Parent

Namespace

Coolio::Socket

Public Class Methods

connect(socket, *args) click to toggle source
# File lib/cool.io/socket.rb, line 12
def self.connect(socket, *args)

  new(socket, *args).instance_eval do
    @_connector = Connector.new(self, socket)
    self
  end
end
new(*args) click to toggle source

Just initializes some instance variables to avoid warnings and calls super().

# File lib/cool.io/socket.rb, line 22
def initialize *args
  @_failed = nil
  @_connector = nil
  super
end

Public Instance Methods

attach(evloop) click to toggle source
# File lib/cool.io/socket.rb, line 30
def attach(evloop)
  raise RuntimeError, "connection failed" if @_failed

  if @_connector
    @_connector.attach(evloop)
    return self
  end

  super
end
on_connect() click to toggle source

Called upon completion of a socket connection

# File lib/cool.io/socket.rb, line 42
def on_connect; end
on_connect_failed() click to toggle source

Called if a socket connection failed to complete

# File lib/cool.io/socket.rb, line 46
def on_connect_failed; end
Also aliased as: on_resolve_failed
on_resolve_failed() click to toggle source

Called if a hostname failed to resolve when connecting Defaults to calling on_connect_failed

Alias for: on_connect_failed

[Validate]

Generated with the Darkfish Rdoc Generator 2.