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

how to cancel a TCP.create_connection? #414

Open
hannesm opened this issue Jul 30, 2019 · 1 comment
Open

how to cancel a TCP.create_connection? #414

hannesm opened this issue Jul 30, 2019 · 1 comment

Comments

@hannesm
Copy link
Member

hannesm commented Jul 30, 2019

I try to implement a protocol which sets custom connection timeouts, so my attempt was to Lwt.cancel (or Lwt.pick [ create_connection ... ; sleep timeout ]), but it turns out that this doesn't do anything, instead after the connection establishment timeout, the create_connection task continues to run. Is there a way to cancel them?

@hannesm
Copy link
Member Author

hannesm commented Jul 30, 2019

a "trick" seems to be to use another mutable variable (or Lwt_switch.t or similar).

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

1 participant