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 control timeouts and/or cancel async operations #590

Open
adminnz opened this issue Aug 6, 2024 · 2 comments
Open

How to control timeouts and/or cancel async operations #590

adminnz opened this issue Aug 6, 2024 · 2 comments

Comments

@adminnz
Copy link

adminnz commented Aug 6, 2024

I have a need to "test" if I can connect to an AMQP server, within 10 seconds (for a feedback to a user).

But the Connection.Factory.CreateAsync(...) provides no way that I can see to pass in a cancellationToken or timeout.

Diving into the source code, it doesnt appear there is any control over the TcpTransport's Socket.ConnectAsync.

How would you suggest to attempt a connection and Session with a short 10 timeout or cancellation?

@xinchen10
Copy link
Member

Do you need to test just if the ip:port is accessible, or if an AMQP connection can be fully established?

@adminnz
Copy link
Author

adminnz commented Aug 27, 2024

I need to test if the AMQP connection can be fully established.

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