On Wed, Dec 9, 2009 at 7:26 AM, Benny Prijono <bennylp at teluu.com> wrote: > On Mon, Nov 30, 2009 at 10:26 PM, Christian Gan > <christian.gan at librestream.com> wrote: >> Just out of curiosity, is there any particular reason why in Visual Studio >> PJSIP compiles ioqueue_select.c in debug and ioqueue_winnt.c in release?? It >> caused us problems when we found our release code was behaving differently, >> until we noticed that these two files were different for the projects. > > To cut the long story short, I preferred to use IOCP on WinNT since > it's more efficient, or so I thought. So IOCP is what gets used on > Release build. On the other hand, select() backend is used everywhere > else, and since there's so few of us here at pjsip and we mainly use > Windows as our development platform, we needed to find a way to test > select() backend regularly, hence the Debug vs Release difference. > >> Mainly because we added a call to getsockname() in our transport callback >> for on_accept_complete (), which fails for the ioqueue_winnt.c version >> because the SO_UPDATE_ACCEPT_CONTEXT socket option had not been set yet. >> > > Aha! We also found the same problem when we implemented (the new) TLS > on 1.5, and I've forgotten about SO_UPDATE_ACCEPT_CONTEXT back then, > so we solved it differently, I think. Upon checking the source code > again, it looks like we do call setsockopt(SO_UPDATE_ACCEPT_CONTEXT), > but it seems that we call it at wrong time, in pj_ioqueue_accept() > while it should have been in ioqueue_on_accept_complete()? > I just created http://trac.pjsip.org/repos/ticket/1001 for this. -benny