Parent

Coolio::Socket::Connector

Public Class Methods

new(coolio_socket, ruby_socket) click to toggle source
# File lib/cool.io/socket.rb, line 58
def initialize(coolio_socket, ruby_socket)
  @coolio_socket, @ruby_socket = coolio_socket, ruby_socket
  super(ruby_socket, :w)
end

Public Instance Methods

on_writable() click to toggle source
# File lib/cool.io/socket.rb, line 63
def on_writable
  evl = evloop
  detach

  if connect_successful?
    @coolio_socket.instance_eval { @_connector = nil }
    @coolio_socket.attach(evl)
    @ruby_socket.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, [1].pack("l"))
    @ruby_socket.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_KEEPALIVE, true)

    @coolio_socket.__send__(:on_connect)
  else
    @coolio_socket.instance_eval { @_failed = true }
    @coolio_socket.__send__(:on_connect_failed)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.