Class | Irc::Socket
In: | lib/rbot/ircsocket.rb
Parent: | Object

wrapped TCPSocket for communication with the server. emulates a subset of TCPSocket functionality

### Methods

clearq connect connected? emergency_puts filter= flush gets handle_socket_error new queue select shutdown

### Classes and Modules

Class Irc::Socket::IdentityFilter

### Constants

MAX_IRC_SEND_PENALTY | = | 10

### Attributes

bytes_received | [R] | total number of bytes received from the irc server
bytes_sent | [R] | total number of bytes sent to the irc server
filter | [R] | an optional filter object. we call @filter.in(data) for all incoming data and @filter.out(data) for all outgoing data
lines_received | [R] | total number of lines received from the irc server
lines_sent | [R] | total number of lines sent to the irc server
server_uri | [R] | normalized uri of the current server
throttle_bytes | [R] | accumulator for the throttle

### Public Class methods

new(server_list, host, opts={})

server_list: | list of servers to connect to
host: | optional local host to bind to (ruby 1.7+ required)

create a new Irc::Socket

### Public Instance methods

clearq()
connect()

open a TCP connection to the server

connected?()
emergency_puts(message, penalty = false)

used to send lines to the remote IRCd by skipping the queue message: IRC message to send it should only be used for stuff that *must not* be queued, i.e. the initial PASS, NICK and USER command or the final QUIT message

filter=(f)

set filter to identity, not to nil

flush()

flush the TCPSocket

gets()

get the next line from the server (blocks)

handle_socket_error(string, e)
queue(msg, chan=nil, ring=0)
select(timeout=nil)

Wraps Kernel.select on the socket

shutdown(how=2)

shutdown the connection to the server

[Validate]