Skip to content

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

ibc opened this Issue Jun 2, 2011 · 3 comments

3 participants

ibc commented Jun 2, 2011

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.

ibc commented Sep 12, 2011

Hi, any comment about this issue?

Thanks a lot.

mislav commented Jan 15, 2012

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

ibc commented Jan 15, 2012

Great! Thanks a lot.

@sodabrew sodabrew closed this Apr 8, 2016
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.