Skip to content


Subversion checkout URL

You can clone with
Download ZIP


set_comm_inactivity_timeout doesn't cause unbind() to be called with cause (in EM server side) #216

ibc opened this Issue · 3 comments

2 participants

ibc commented

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.