class EventMachine::Connection

Public Instance Methods

close_connection(after_writing = false) click to toggle source

Close the connection, optionally after writing

# File lib/revem.rb, line 209
def close_connection(after_writing = false)
  return close_connection_after_writing if after_writing
  @wrapped_rev.close
end
close_connection_after_writing() click to toggle source

Close the connection after all data has been written

# File lib/revem.rb, line 215
def close_connection_after_writing
  @wrapped_rev.output_buffer_size.zero? ? @wrapped_rev.close : @wrapped_rev.should_close_after_writing
end
get_peername() click to toggle source
# File lib/revem.rb, line 219
def get_peername
    family, port, host_name, host_ip = @wrapped_rev.peeraddr
    Socket.pack_sockaddr_in( port, host_ip) # pack it up :)
end
heres_your_socket(instantiated_rev_socket) click to toggle source

Callback fired when data is received def receive_data(data); end

# File lib/revem.rb, line 198
def heres_your_socket instantiated_rev_socket
  instantiated_rev_socket.call_back_to_this self
  @wrapped_rev = instantiated_rev_socket
end
post_init() click to toggle source

we will need to call ‘their functions’ appropriately – the commented out ones, here

Callback fired when connection is created

# File lib/revem.rb, line 191
def post_init; end
send_data(data) click to toggle source

Send data to the current connection – called by them

# File lib/revem.rb, line 204
def send_data(data)
  @wrapped_rev.write data
end
unbind() click to toggle source

Callback fired when connection is closed

# File lib/revem.rb, line 194
def unbind; end

Public Class Methods

new(*args) click to toggle source
# File lib/revem.rb, line 183
def self.new *args
  allocate#.instance_eval do
  #  initialize *args
  #end
end