Giter Club home page Giter Club logo

Comments (3)

vtortola avatar vtortola commented on September 18, 2024

If you are going to have only one client connected, it may not be worth to use a buffer manager :) And if you still want to use it, use at least * 5 just in case since your client can disconnect and reconnect before the byte[] is returned to the buffer manager.

The send buffer value is something you probably want to experiment and check different approaches. Basically, the component will try to fill that buffer before sending, and then send a complete frame with that size. If it is to small, there are some little size over head because it implies more frame headers. If it is too big, control frames cannot be send in the middle of a data frame, only between frame and frame, so in a slow connection it may cause a timeout if the timeout value is low. There is a ping strategy for bandwidth saving where normal data also prevents the timeout from happening, but it is not in Nuget yet (it is in GitHub though, so you can try if you want). However the value you are using is probably OK.

Probably you want sorter timeouts, like 2 to 5 seconds, but again it depends. Tweaking is a per-case basis, that is why I provided as many options as I could :)

from websocketlistener.

pboyer avatar pboyer commented on September 18, 2024

Thanks, I'll keep these in mind. :)

I'm having a lot of fun with your project. AFAIK, you have the only open source WebSocket library for .NET that properly supports compression. Congrats.

from websocketlistener.

vtortola avatar vtortola commented on September 18, 2024

Thanks! :) However compression is not as good as it should be, because it only compress individual messages, but cannot take advantage of sharing the compression context across messages, which would yield a better compression. This limitation exists because how DeflateStream is implemented.

However it would be still good for you since you plan to send big payloads 👍

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.