Benny, Benny Prijono wrote: > On Tue, Aug 10, 2010 at 5:27 AM, Samuel Vinson<samuelv at laposte.net> wrote: > >> Benny, >> >> Is it possible to reopen UDP socket when pj_ioqueue_recvfrom/recvfrom... >> returns PJ_STATUS_FROM_OS(ENOTCONN) ? >> If yes, where is the best place ? >> >> > > We made a patch for somebody before, to recreate the UDP socket handle > inside the ioqueue itself when we have that error. But we haven't > tested it ourselves on a real device, so I don't know how it would > work. > I finally got around to trying this. Your patch is excellent, but I got mixed results; still, I have that working now. In more details: your patch worked perfectly in this scenario: * launch the application * send it to the background * lock the iPhone * unlock it * bring the app back If however I get a call while locked, both pj_sock_setsockopt(... SO_REUSEADDR) and pj_sock_bind() fail for me. Interestingly, ignoring errors from those calls seems to be ok for my scenario (we only use UDP for RTP and RTCP, of course). I'm not sure I understand why it does, and why this is not a problem for Darald. Admittedly, I have run limited tests so far; we'll see what comes up during QA. That said, right now I'm a happy camper :) Thanks again for the patch. Andrea -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20100826/dc488a55/attachment.html>