public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
* Problems with the (new) implementation of AF_UNIX datagram sockets
@ 2021-04-14 16:15 Ken Brown
  2021-04-15 11:49 ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Brown @ 2021-04-14 16:15 UTC (permalink / raw)
  To: cygwin-devel

Hi Corinna,

This is a follow-up to

   https://cygwin.com/pipermail/cygwin/2021-April/248284.html

I don't know if you've been following that thread, but two serious problems with 
datagram sockets (on the topic/af_unix branch) have shown up.

1. Writing will block until a connection to the peer's pipe can be made.  In 
particular, if there are two consecutive writes with the same peer, the second 
one will block until the peer reads the first message.  This happens because the 
peer's pipe is not available for the second connection until the peer 
disconnects the first connection.  This is currently done in recvmsg, and I 
don't see a straightforward way to do it anywhere else.

2. There's no way for select to test whether a datagram socket is ready for 
writing.  That's because we can't know whether a connection to a hypothetical 
peer's pipe will be possible.  According to Stevens, the issue *should* be 
whether there's space in the socket's send buffer.  But our sockets don't have a 
send buffer until they connect to a pipe.

I think the solution to both problems is for Cygwin to maintain a send buffer 
for datagram sockets.  Does that seem right, or do you have another idea?

I haven't yet thought much about how to implement a send buffer, but I wanted to 
check with you before investing time in it.  And if you agree that this is the 
way to go, I'd appreciate any implementation suggestions you might have.

Thanks.

Ken

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-04-19  8:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 16:15 Problems with the (new) implementation of AF_UNIX datagram sockets Ken Brown
2021-04-15 11:49 ` Corinna Vinschen
2021-04-15 13:16   ` Ken Brown
2021-04-15 13:58     ` Corinna Vinschen
2021-04-15 14:53       ` Ken Brown
2021-04-15 23:50         ` Mark Geisert
2021-04-16  9:37           ` Corinna Vinschen
2021-04-17  2:54             ` Mark Geisert
2021-04-17 16:05               ` Ken Brown
2021-04-19  8:48                 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).