Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udp.recv(3.seconds) didn't throw exception and wait forever #1429

Closed
mzfhhhh opened this issue Feb 16, 2016 · 2 comments
Closed

udp.recv(3.seconds) didn't throw exception and wait forever #1429

mzfhhhh opened this issue Feb 16, 2016 · 2 comments

Comments

@mzfhhhh
Copy link

mzfhhhh commented Feb 16, 2016

my app need wait several seconds to check data arrived,buf "udp.recv(3.seconds)" doesn't work and wait forever

vibe 0.7.27 demo

shared static this()
{
    runTask({
        auto udp_listener = listenUDP(1234);
        while (true) {
            logInfo("waiting...");
            auto pack = udp_listener.recv(3.seconds);
            logInfo("Got packet: %s", cast(string)pack);
        }
    });
}
@mzfhhhh
Copy link
Author

mzfhhhh commented Feb 16, 2016

i add this line in "libevent2.d" line1013,and then it's working

m_driver.m_timers.getUserData(tm).owner = Task.getThis();

@s-ludwig
Copy link
Member

You are right, your code should be used instead of the acquireTimer call - I obviously confused that with the acquire() calls that are used in other places to set the owner. I'll create a test and add the fix.

s-ludwig added a commit that referenced this issue Feb 16, 2016
UDP receive timeout doesn't work for the libevent driver.
s-ludwig added a commit that referenced this issue Feb 20, 2016
UDP receive timeout doesn't work for the libevent driver.

(cherry picked from commit 443e071)
s-ludwig added a commit that referenced this issue Feb 20, 2016
s-ludwig added a commit that referenced this issue Apr 10, 2016
UDP receive timeout doesn't work for the libevent driver.

(cherry picked from commit 443e071)

(cherry picked from commit 6997dc3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants