[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] multiple TCP server under windows fails



On Thu, Aug 29, 2013 at 5:56 PM, boit sanssoif <boit.sanssoif@xxxxxxxxx> wrote:
> Hi,
>
> I'm porting a linux application (mono threaded which start two TCP
> servers) to windows.
>
> The TCP server implementation is largely based on this page
> http://www.wangafu.net/~nickm/libevent-book/Ref8_listener.html
>
> I compiled libevent (2.0.21) for windows under linux using mingw, then
> I ported my application and tried it using wine under linux, it worked
> well like the linux one (libevent is statically linked in the exe).
>
> But when I executed the application under a real windows, I can't
> connect to the second TCP server.
> a netstat -a shows me that the TCP server is started, but the accept
> callback of my code is never fired.
>
> I tried to put some log into the libevent listener.c file just after
> the accept instruction in the listener_read_cb function and I don't
> see anything too.
>
> what can I do to find where is the problem ?

The first thing to do would be to try to see whether the unaltered
code works fine on Windows or not.  That would help track down whether
there's a bug on your side or on the Libevent side.

Another thing to check would be whether the windows misbehavior always
happens ,or only if you turn on IOCP.  The windows IOCP evconnlistener
backend is somewhat different from the regular backend.

Another useful direction, if the unaltered code *does* work okay on
both platforms but yours doesn't, would be to try to start with your
program and cut it down until there's  a minimal program that exhibits
the misbehavior you're seeing on Windows.

best wishes,
-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.