Re: unix socket hang when connect

2025-04-08 Thread Corinna Vinschen via Cygwin
On Apr 7 12:35, Christian Franke via Cygwin wrote: > Yuyi Wang via Cygwin wrote: > > Thank you Christian, setting SO_PEERCRED on the client socket works. It's a > > little wierd, though. Is it OK to always set it to NULL on a unix socket? > > No, this is a Cygwin extension, originally added for p

RE: [EXTERNAL] Re: unix socket hang when connect

2025-04-07 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin
> I'm agree with you, but on other *nix platforms, and even on Windows with > winsock and AF_UNIX, connect() doesn't wait for accept(). I would like such > behavior. The behavior that connect() does not require accept() from the other end is platform-specific. It's your other system's courtesy, a

Re: unix socket hang when connect

2025-04-07 Thread Christian Franke via Cygwin
Yuyi Wang via Cygwin wrote: Thank you Christian, setting SO_PEERCRED on the client socket works. It's a little wierd, though. Is it OK to always set it to NULL on a unix socket? No, this is a Cygwin extension, originally added for postfix. -- Regards, Christian -- Problem reports: https

Re: unix socket hang when connect

2025-04-07 Thread Yuyi Wang via Cygwin
Thank you Christian, setting SO_PEERCRED on the client socket works. It's a little wierd, though. Is it OK to always set it to NULL on a unix socket? -- Yuyi Wang -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https:/

Re: unix socket hang when connect

2025-04-07 Thread Christian Franke via Cygwin
Yuyi Wang via Cygwin wrote: Below is a simple unix socket testing code. It creates a unix socket server and a client to connect to it immediately. It works on Linux and macOS, but hangs on cygwin. bind + listen work well, but seems that the connect method never returns. #include #include #in

Re: unix socket hang when connect

2025-04-07 Thread Yuyi Wang via Cygwin
> I guess connect() just is just waiting accept(). I'm agree with you, but on other *nix platforms, and even on Windows with winsock and AF_UNIX, connect() doesn't wait for accept(). I would like such behavior. -- Yuyi Wang -- Problem reports: https://cygwin.com/problems.html FAQ:

Re: unix socket hang when connect

2025-04-07 Thread Takashi Yano via Cygwin
On Mon, 7 Apr 2025 15:08:32 +0800 Yuyi Wang wrote: > Below is a simple unix socket testing code. It creates a unix socket server > and > a client to connect to it immediately. It works on Linux and macOS, but hangs > on > cygwin. bind + listen work well, but seems that the connect method never