This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: UDP/DTLS sockets communication pattern is broken in Cygwin
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 12 Apr 2013 17:56:06 +0200
- Subject: Re: UDP/DTLS sockets communication pattern is broken in Cygwin
- References: <031222CBCF33214AB2EB4ABA279428A30140C1ACA374 at SJCPMAILBOX01 dot citrite dot net> <20130411212115 dot GA1376 at ednor dot casa dot cgf dot cx> <031222CBCF33214AB2EB4ABA279428A30140C1ACA378 at SJCPMAILBOX01 dot citrite dot net> <20130412114354 dot GC11358 at calimero dot vinschen dot de> <031222CBCF33214AB2EB4ABA279428A30140C1ACA37B at SJCPMAILBOX01 dot citrite dot net>
- Reply-to: cygwin at cygwin dot com
On Apr 12 08:44, Oleg Moskalenko wrote:
>
> >
> > However, I think I found a workaround on the application level.
> > Apparently all packets sent to a specific address are sent to the first socket
> > which has been bound to the address. If that socket has been closed, the next in
> > line gets the packets (unless it has been connected and the sender is not the
> > connected address). So what I did was this:
> >
> > Before starting step 14, I created a third socket, which then replaced the server
> > socket:
>
> Thank you, Corinna, for the reply and for the idea.
>
> Unfortunately, the workaround will work well only in the case of a single client.
> In the multiple clients scenario, it will create a sort of race condition:
>
> 1) some packets already scheduled by OS to the "original" packet will be lost;
> 2) some packets delivered in between the sockets destruction/creation will be wrongly rejected.
>
> But this is better than nothing. I'll think whether we can live with it.
Too bad. I don't know the DTLS protocol, but isn't it possible to do
the server part with a single UDP socket? If you keep track of the
already connected clients, you know if the just incoming packet is a
connected or connecting client, and then you can use different threads
to handle the packet further.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple