-
Notifications
You must be signed in to change notification settings - Fork 272
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
About hub.connect on windows run as blocking mode on uWebSocket #7
Comments
It blocks on DNS lookup, that's the only thing blocking. It's a valid issue for uSockets too, I haven't solved it yet. DNS lookup should happen in a thread pool. |
Thank you for quick response, I changed my design to use uws in multithread because I found it don't work for creating multi group and make connect calls, only last connect call works. |
You shouldn't hack with threading. If you require nonblocking DNS lookup then do that part yourself with a third party library and pass the IP to connect |
the main problem for single thread is: below code only connect to url2 will work fine, no callback recieved from url1, is this a bug? thank you! sample code: group2 = hub_->createGroup(); |
Well since the first connection will block on DNS resolution the second connection might time out? Both should work. |
Hi I could not find a place to quest under uWebsocket, so I post it here:
On winodws 10, while calling hub.connect to wws, it will block several seconds.
if I add predefine SOCK_CLOEXEC;SOCK_NONBLOCK; to project, error occured with identifier "accept4" not found error.
I am using the hub to connect to multi wws, so I need this "connect" function excute as nonblocking, could you please advice?
thank you!
The text was updated successfully, but these errors were encountered: