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

Abort connection needed #50

Open
ghost opened this issue Jun 15, 2017 · 1 comment
Open

Abort connection needed #50

ghost opened this issue Jun 15, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 15, 2017

I think there should be the way to abort the connection after some timeout. I'm now using this solution from JakeChampion/fetch#175 to wrap the connect() function, but it will be nice, if there was a way to abort the connection attempt after specified period of time. Or at least abort it directly like Bluetooth.abort() - that could be used in solution above. At this moment there isn't any.

@ithieund
Copy link

@l-nawrocki ,
You can use setTimeout and invoke disconnect() when timeout. This will also abort the connect() and throw error in connect().catch()

It worked for me.
Happy coding!

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