Coder Social home page Coder Social logo

Comments (5)

ehsannm avatar ehsannm commented on August 25, 2024 2

I have created a very fast and modular framework and is used in production in our company. You can check how i used gnet and gobwas/ws together.
Https://github.com/clubpay/ronykit

The related code is in std/gateways/fastws

from ws.

ehsannm avatar ehsannm commented on August 25, 2024 1

@spy16 thanks for the point, i did write a test in the testenv package and realized that you were right about the issue, i fixed it and pushed. You can check it again.

from ws.

spy16 avatar spy16 commented on August 25, 2024 1

Thanks, I will check this out.

I will also close this issue since it's more related to the source reader itself than this package.

from ws.

cristaloleg avatar cristaloleg commented on August 25, 2024

Hey, no idea about gnet, maybe @panjf2000 has some ideas.

from ws.

spy16 avatar spy16 commented on August 25, 2024

@ehsannm Thank you! This is really helpful.

Have you tried sending a websocket message that is larger than the ReadBufferCap set in gnet though? I think your implementation definitely resolves the first issue for me, since the part of reading all the control frames is in a loop.

But once you get a text/binary payload frame, if the frame size is bigger than the ReadBufferCap set on gnet, I believe, you would also run into the short-buffer error (or you might incorrectly miss a few bytes of the message, which will be read in the next OnTraffic which can corrupt all interactions after that point for that connection ).

For example, if you set ReadBufferCap to 1024, the websocket message can only be upto 1016 bytes (the remaining 8 bytes are used for the frame header)

from ws.

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.