class Rev::Socket

Public Instance Methods

attach(evloop) click to toggle source
# File lib/rev/socket.rb, line 22
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/rev/socket.rb, line 34
def on_connect; end
on_connect_failed() click to toggle source

Called if a socket connection failed to complete

# File lib/rev/socket.rb, line 38
def on_connect_failed; end
on_resolve_failed() click to toggle source

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

# File lib/rev/socket.rb, line 43
def on_resolve_failed
   on_connect_failed
end

Public Class Methods

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

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