I'm trying to build a system ontop of event machine that will detect when a TCP connection has failed and will test to see if a reconnect can be fired. I've gone through all of the eventmachine code but can't seem to find where there is a callback for the connection either timing out in action or in reconnection. Even though I've set the times in the code, there is no callback on the pending connect, and if I try to re fire reconnect I get no feedback as to whether the connection has succeeded or failed. I'm using it to connect to effectively a telnet interface.
EventMachine.run do
c = EventMachine.connect "10.8.1.99",5000,ConnectInterface
c.pending_connect_timeout = 10
end
Any help would be greatly appreciated.
EventMachine provide the unbind method for this:
be aware The unbind method will get called on disconnect whether you triggered the disconnect or not.