-
Notifications
You must be signed in to change notification settings - Fork 128
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
Can't find way to set WebSocket connect timeout #355
Comments
http://arsd-official.dpldocs.info/arsd.http2.WebSocket.this.html There's a second argument for the constructor of type Config: http://arsd-official.dpldocs.info/arsd.http2.WebSocket.Config.html Which has a member http://arsd-official.dpldocs.info/arsd.http2.WebSocket.Config.timeoutFromInactivity.html .......oooh but that doesn't apply for the connect step. So there's the bug lemme see about fixing that. |
Just pushed a thing to master, if you wanna grab that and run some tests I think that fixes it so the timeout from inactivity config setting is respected. I plan on rewriting this under my new async system at some point in the next few months, when I can find the time in between other work, but this should work for now. |
Sorry yeah I forgot to mention that part. I tried out that fix and it works. Thanks! |
I've copied the WebSocket code into my project to work around this but figured I should still mention it.
Ubuntu 20 on WSL2
I have a program like this:
If I try to connect to a port with nothing listening it takes over 2 minutes to time out:
On Windows it times out in a couple seconds. Maybe there's a way to change the socket defaults for the process somehow but it would be nice if the
WebSocket
had a config option for it since its underlyingSocket
is private; or at least having a hard-coded timeout that's shorter would be good. Modifying the socket's send timeout by adding this to theWebSocket
constructor:results in
std.socket.SocketOSException@std/socket.d(2852): Unable to connect socket: Operation now in progress
after 7 seconds. Maybe there's a fancier way usingselect
or something though.Thanks!
The text was updated successfully, but these errors were encountered: