I start a EM TCP server (1.0.0.beta3) and set set_comm_inactivity_timeout=5.
A client connects to the server and sends/receives no data. After 5 seconds unbind() is called with no cause argument. Shouldn't it be called with Errno::ETIMEDOUT?
Also, there is no way to know if the connection has been locally or remotely terminated. As a hack I rewrite close_connection() and close_connection_atfer_writing() (I set an attribute @local_disconenction=true) but these methods are not called when inactivity_timeout triggers, so I have no way to know who has closed the connection, neither the reason (as no cause is passed to unbind method).
So basically I suggest unbind() to be called with Errno::ETIMEDOUT when EM has accepted a connection but no data is sent/received so comm_inactivity_timeout triggers.
Hi, any comment about this issue?
Thanks a lot.
EM does call unbind with ETIMEDOUT, but only if the unbind method has an arity of 1. If your unbind method is declared like this:
def unbind(reason = nil)
EM will call unbind but not pass it an argument. I patched this in #289
Great! Thanks a lot.