This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tolj@wapme-systems.de: Re: Problem with accept?!! (was: Re:apache cygwin package hangs when MaxRequestsPerChild reached!)]


Corinna Vinschen wrote:
On Mon, Jun 02, 2003 at 01:18:25PM +0200, Corinna Vinschen wrote:

   Duplicated sockets all share the same event handler.
[...]
As a starting point I'm now throwing some fuel in here:  What about
running accept and connect in another thread which can be terminated
using TerminateThread if a signal arrives?

I've applied a patch which implements blocking accept and connect now using threads. All my tests worked (ssh, ftp, telnet rlogin, rsh, fake server and client to test interrupting the blocking calls) but nevertheless I'd appreciate if somebody takes a heart and gives that stuff also a thorough testing.

Corinna,


i took a heart and did some testing.

1. You must pass the winsock error between the threads.
2. I changed the connect stuff to nonblocking and use select to wait. This should make sure that the connect will be continued in background if an interrupt comes in just like the opengroup specifies.
3. accept will use select to wait for incoming connections, the accept call itself will be made in the waiting thread. This should make sure that accept is not interrupted and avoid a loss of an already connected socket when TerminateThread stops the thread when it is already returning.


Attached are my changes so far, i will do some further testing.

Thomas


Attachment: fhandler_socket.patch
Description: plain/text


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]