Class: AMQ::Client::Async::CoolioClient::Socket

### Home Classes Methods

### In Files

- lib/amq/client/async/adapters/coolio.rb

### Parent

Coolio::TCPSocket

### Methods

- ::connect
- #on_close
- #on_connect
- #on_connect_failed
- #on_read
- #puts_data
- #send_raw

### Class/Module Index

Quicksearch

- AMQ
- AMQ::Client
- AMQ::Client::Async
- AMQ::Client::Async::Adapter
- AMQ::Client::Async::Adapter::ClassMethods
- AMQ::Client::Async::AuthMechanismAdapter
- AMQ::Client::Async::AuthMechanismAdapter::External
- AMQ::Client::Async::AuthMechanismAdapter::Plain
- AMQ::Client::Async::Callbacks
- AMQ::Client::Async::Channel
- AMQ::Client::Async::Consumer
- AMQ::Client::Async::CoolioClient
- AMQ::Client::Async::CoolioClient::Socket
- AMQ::Client::Async::Entity
- AMQ::Client::Async::EventMachineClient
- AMQ::Client::Async::Exchange
- AMQ::Client::Async::Extensions
- AMQ::Client::Async::Extensions::RabbitMQ
- AMQ::Client::Async::Extensions::RabbitMQ::Basic
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::ChannelMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::ConsumerMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::QueueMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Confirm
- AMQ::Client::Async::Extensions::RabbitMQ::Confirm::ChannelMixin
- AMQ::Client::Async::ProtocolMethodHandlers
- AMQ::Client::Async::Queue
- AMQ::Client::Async::RegisterEntityMixin
- AMQ::Client::BadLengthError
- AMQ::Client::ConnectionClosedError
- AMQ::Client::ConsumerTagGenerator
- AMQ::Client::Framing
- AMQ::Client::Framing::IO
- AMQ::Client::Framing::IO::Frame
- AMQ::Client::Framing::String
- AMQ::Client::Framing::String::Frame
- AMQ::Client::HandlersRegistry
- AMQ::Client::InconsistentDataError
- AMQ::Client::Logging
- AMQ::Client::Logging::IncompatibleLoggerError
- AMQ::Client::MissingHandlerError
- AMQ::Client::NoFinalOctetError
- AMQ::Client::Openable
- AMQ::Client::Openable::ImproperStatusError
- AMQ::Client::PossibleAuthenticationFailureError
- AMQ::Client::ServerNamedEntity
- AMQ::Client::Settings
- AMQ::Client::TCPConnectionFailed
- AMQ::Client::UnknownExchangeTypeError
- AMQ::Protocol
- AMQ::Protocol::GetResponse

No matching classes.

# AMQ::Client::Async::CoolioClient::Socket

Cool.io socket delegates most of its operations to the parent adapter. Thus, 99.9% of the time you don't need to deal with this class.

@api private @private

### Attributes

adapter[RW]

### Public Class Methods

connect(adapter, host, port) click to toggle source

Connects to given host/port and sets parent adapter.

@param [CoolioClient] @param [String] @param [Fixnum]

    # File lib/amq/client/async/adapters/coolio.rb, line 43
    def self.connect(adapter, host, port)
      socket = super(host, port)
      socket.adapter = adapter
      socket
    end

### Public Instance Methods

on_close() click to toggle source

Triggers socket_disconnect callback

    # File lib/amq/client/async/adapters/coolio.rb, line 63
    def on_close
      adapter.socket_disconnected
    end

on_connect() click to toggle source

Triggers socket_connect callback

    # File lib/amq/client/async/adapters/coolio.rb, line 50
    def on_connect
      #puts "On connect"
      adapter.socket_connected
    end

on_connect_failed() click to toggle source

Triggers tcp_connection_failed callback

    # File lib/amq/client/async/adapters/coolio.rb, line 68
    def on_connect_failed
      adapter.tcp_connection_failed
    end

on_read(data) click to toggle source

Triggers on_read callback

    # File lib/amq/client/async/adapters/coolio.rb, line 56
    def on_read(data)
      # puts "Received data"
      # puts_data(data)
      adapter.receive_data(data)
    end

send_raw(data) click to toggle source

Sends raw data through the socket

param [String] Binary data

    # File lib/amq/client/async/adapters/coolio.rb, line 75
    def send_raw(data)
      # puts "Sending data"
      # puts_data(data)
      write(data)
    end

### Protected Instance Methods

puts_data(data) click to toggle source

Debugging routine

    # File lib/amq/client/async/adapters/coolio.rb, line 83
    def puts_data(data)
      puts "    As string:     #{data.inspect}"
      puts "    As byte array: #{data.bytes.to_a.inspect}"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.