-
Notifications
You must be signed in to change notification settings - Fork 21
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
Duration optional? Forever? #3
Comments
Hi @kevinelliott, thanks for using udp! |
Hi @xenoken ... thank you for the library! Upon removal of the duration, my application exits immediately and does not receive any UDP packets. I'm assuming now I need some kind of main state loop with sleeps in order to prevent the application from exiting? |
That's correct @kevinelliott. |
Ahh, I see... what I was looking for was a never ending listen... I need to process millions of UDP packets over time. |
Yes, udp.listen() is indeed never ending. It will keep listening for packets even though the function returns immediately. for example: var receiver = await UDP.bind(Endpoint.loopback(port: Port(54321)); var success = await receiver.listen((datagram){ // even though the execution reaches this point, receiver is still listening to udp packets. // ...end of program here... |
What if we want the UDP listen to be forever or until interrupted in some way?
The text was updated successfully, but these errors were encountered: