# File lib/cool.io/eventmachine.rb, line 175 def self.connect(*args) a = super *args # the connect timer currently kills TCPServer classes. I'm not sure why. #@connection_timer = ConnectTimer.new(14) # needs to be at least higher than 12 :) #@connection_timer.parent = a #@connection_timer.attach(Coolio::Loop.default) a end
# File lib/cool.io/eventmachine.rb, line 123 def call_back_to_this parent @call_back_to_this = parent parent.post_init end
# File lib/cool.io/eventmachine.rb, line 137 def connection_has_timed_out return if closed? # wonder if this works when you're within a half-connected phase. # I think it does. What about TCP state? close unless closed? @call_back_to_this.unbind end
# File lib/cool.io/eventmachine.rb, line 170 def fail #@connection_timer.detch if @connection_timer @call_back_to_this.unbind end
# File lib/cool.io/eventmachine.rb, line 154 def on_close @call_back_to_this.unbind # about the same ltodo check if they ARE the same here end
# File lib/cool.io/eventmachine.rb, line 128 def on_connect # @connection_timer.detach if @connection_timer # won't need that anymore :) -- with server connecteds we don't have it, anyway # TODO should server accepted's call this? They don't currently # [and can't, since on_connect gets called basically in the initializer--needs some code love for that to happen :) @call_back_to_this.connection_completed if @call_back_to_this end
# File lib/cool.io/eventmachine.rb, line 162 def on_connect_failed fail end
# File lib/cool.io/eventmachine.rb, line 166 def on_read(data) @call_back_to_this.receive_data data end
# File lib/cool.io/eventmachine.rb, line 158 def on_resolve_failed fail end
Generated with the Darkfish Rdoc Generator 2.