Open CoderNate opened 1 year ago
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 timeoutFromInactivity
:
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.
but that doesn't apply for the connect step
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!