RejectedSoftware Forums

Sign up

UDP recv timeout

Hello.
I want to implement reliable packet delivery protocol on top of UDP.
After send() I need to wait acknowledge datagram until two-way-delay timeout, but recv() has no timeout parameter.
What is the right way (in the scope of vibe.d) to do that?
Should I run two additional Tasks with manual events and wait one of them or there is a simpler way to wait two events (recv and timeout) simultaneously at the same fiber?

Re: UDP recv timeout

Am 20.02.2014 10:50, schrieb aleksander.usov:

Hello.
I want to implement reliable packet delivery protocol on top of UDP.
After send() I need to wait acknowledge datagram until two-way-delay timeout, but recv() has no timeout parameter.
What is the right way (in the scope of vibe.d) to do that?
Should I run two additional Tasks with manual events and wait one of them or there is a simpler way to wait two events (recv and timeout) simultaneously at the same fiber?

Currently the two-task method is necessary, but I think that either a
timeout parameter or a separate waitForData should be implemented.
I'll add a github issue for that and will try to still get it into 0.7.19.

Re: UDP recv timeout

https://github.com/rejectedsoftware/vibe.d/issues/540