adamdruppe / arsd

This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.
http://arsd-official.dpldocs.info/arsd.html
531 stars 125 forks source link

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

Open CoderNate opened 1 year ago

CoderNate commented 1 year ago

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(...). https://github.com/adamdruppe/arsd/blob/f98b5e17d651ee815fd4ce787dac1541f1959f2d/http2.d#L4655-L4658

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:

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

adamdruppe commented 1 year ago

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.