On Sat, Jul 20, 2013 at 2:12 AM, Oleg Moskalenko <mom040...@gmail.com> wrote: > I drilled down, eventually, to the bottom of this problem. > > When some kind of socket problem is reported on a UDP socket, then the > EV_READ is generated but there is no data is available. So it will go in > indefinite cycle with libevent. > > The solution is to use recvmsg on a socket in this condition, with flag > MSG_ERRQUEUE. It will read the error message and restore the socket > condition. > > BSD-compatible systems do not do that, this is obviously a Linux > lesser-known extension. > > I am working on including this workaround into the TURN server code, but my > pilot code tests shows that it works perfectly and this is the right > solution.
Thanks for sharing this, Oleg! Is there any reasonable place in the Libevent documentation for us to mention this? (I guess that a UDP-based bufferevent-like thing could wrap this naturally and hide the detail form the user, but we don't have one of those yet.) -- Nick *********************************************************************** To unsubscribe, send an e-mail to majord...@freehaven.net with unsubscribe libevent-users in the body.