AF_UNIX/SOCK_DGRAM is dropping messages

Ken Brown kbrown@cornell.edu
Tue Apr 6 14:59:11 GMT 2021


On 4/6/2021 3:52 AM, Noel Grandin wrote:
> 
> 
> On 2021/04/01 6:02 pm, Ken Brown via Cygwin wrote:
>> Here's the issue, briefly.  The communication is done via a Windows named 
>> pipe. The receiver creates the pipe when it creates and binds its socket.  It 
>> creates only one pipe instance.  The sender connects to the pipe, writes, and 
>> closes its handle.  But the pipe is not available for another sender to 
>> connect to until the receiver reads the message, after which it disconnects 
>> the sender.
>>
> 
> This
> 
>    https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipe-instances
> 
> seems to indicate that multiple pipe instances are needed to handle multiple 
> clients nicely - it also has sample code for such.

Yes, we do that for stream sockets that are listening.  Whenever there's a 
connection, a new pipe instance is created so that the listening socket can 
continue listening.  But I don't see an easy way to adapt this to datagram 
sockets, and I'm not even sure it's appropriate in that case.

Ken


More information about the Cygwin mailing list