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

Calling webSocket.isDataPending gives "operation was attempted on something that is not a socket" #354

Open
CoderNate opened this issue Jan 6, 2023 · 1 comment

Comments

@CoderNate
Copy link

OS: Windows

The readSet here is static and in similar places where a SocketSet is used there is a call to readSet.reset() prior to calling readSet.add(...).

arsd/http2.d

Lines 4655 to 4658 in f98b5e1

public bool isDataPending(Duration timeout = 0.seconds) {
static SocketSet readSet;
if(readSet is null)
readSet = new SocketSet();

I'm seeing that isDataPending works okay for the first WebSocket I create in a session but after I close it and create a new WebSocket one of two things happen:

  • Calling isDataPending with a timeout just keeps returning false immediately every time it's called
  • I get std.socket.SocketOSException@std\socket.d(3488): Socket select error: An operation was attempted on something that is not a socket.

If I add in a call to readSet.reset() then everything seems to work fine.

adamdruppe added a commit that referenced this issue Jan 6, 2023
@adamdruppe
Copy link
Owner

that's right i am supposed to reset it, i just barely ever use this function so i didn't test it well. pushed fix up.

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