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 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
# 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
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
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 to the current connection – called by them
# File lib/revem.rb, line 204 def send_data(data) @wrapped_rev.write data end
Callback fired when connection is closed
# File lib/revem.rb, line 194 def unbind; end
# File lib/revem.rb, line 183 def self.new *args allocate#.instance_eval do # initialize *args #end end