This is the mail archive of the cygwin-developers 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]

Cygwin 1.7-1 - non-blocking IO problem


Hi,

I'm porting an application to Cygwin (1.7-1) and have encountered a problem related to non-blocking IO. It appears that write to a socket blocks in non-blocking mode blocks. I've narrowed it down to the attached program.

The program creates 2 socket pairs, then forks and communicates to the child through these pairs. The parent process writes 1MB then reads 1MB, and repeats that 10 times. The child waits a while, then starts writing 10MB while also reading from the other pair in a non-blocking fashion.
- On Cygwin 1.7-1 it hangs
- If I replace the socketpair() by a pipe() it works (it's possible because I make a uni-directional use with each socket pair).
- It seems that the problem also happens with TCP sockets.
- On Linux it works with the socketpair()
- On Cygwin 1.5.25 it also works (it hanged some of the times but I believe it has to do with my installation)

Please advise.
Thanks,
Uri Simchoni

Attachment: nbtest.c
Description: nbtest.c


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