Giter Club home page Giter Club logo

Comments (4)

vtortola avatar vtortola commented on September 18, 2024

How did you reproduce this problem?

Thanks!

from websocketlistener.

Dev-Eloper avatar Dev-Eloper commented on September 18, 2024

Hi,
Sorry for the late reply, I had forgotten about the issue because I had already fixed it locally.
I think I ran into the issue when I did an experiment that involved first reading the first four bytes of a message, then depending on their value doing something with the rest of the message. Reading the first four bytes failed because of the aforementioned test: (4 < buffer.Length - 0) => throw exception.

So under normal circumstances, as long as you always read the entire message, you will not not run into the issue because "count = buffer.Length" and "offset = 0", so "count = buffer.Length - offset".

from websocketlistener.

Dev-Eloper avatar Dev-Eloper commented on September 18, 2024

Ah, I actually still have some code here:

WebSocketMessageReadStream message = await webSocket.ReadMessageAsync(mCancellationTokenSource.Token).ConfigureAwait(false);
byte[] buffer = new byte[4];
message.Read(buffer, 0, 4);

from websocketlistener.

vtortola avatar vtortola commented on September 18, 2024

Included in 2.1.8, Thanks again!

from websocketlistener.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.