### Home Classes Methods

### In Files

- lib/cool.io/socket.rb

### Parent

Coolio::IO

### Namespace

- CLASS Coolio::Socket::Connector

### Methods

- ::connect
- ::new
- #attach
- #on_connect
- #on_connect_failed
- #on_resolve_failed

### Class/Module Index

Quicksearch

- Coolio
- Coolio::AsyncWatcher
- Coolio::Connections
- Coolio::DNSResolver
- Coolio::DNSResolver::Timeout
- Coolio::DSL
- Coolio::DSL::ConnectionBuilder
- Coolio::IO
- Coolio::IO::Watcher
- Coolio::IOWatcher
- Coolio::Listener
- Coolio::Loop
- Coolio::Meta
- Coolio::Server
- Coolio::Socket
- Coolio::Socket::Connector
- Coolio::TCPListener
- Coolio::TCPServer
- Coolio::TCPSocket
- Coolio::TCPSocket::TCPConnectResolver
- Coolio::TCPSocket::TCPConnectSocket
- Coolio::TimerWatcher
- Coolio::UNIXListener
- Coolio::UNIXServer
- Coolio::UNIXSocket
- Cool
- Cool::Coolness
- Cool::IOThunk
- Object
- Thread

No matching classes.

# 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.