GithubHelp home page GithubHelp logo

Doubt with test about mediasoup HOT 6 CLOSED

piranna avatar piranna commented on May 29, 2024
Doubt with test

from mediasoup.

Comments (6)

ibc avatar ibc commented on May 29, 2024 1

65536 casted to unsigned 2^16 is 0.

No, we don't want to validate given numbers in TS later. User should be clever enough to know what uint16 means.

from mediasoup.

piranna avatar piranna commented on May 29, 2024

65536 casted to unsigned 2^16 is 0.

I suspected that was the culprit, thanks to confirm. Then based on the docs and the comment at https://github.com/versatica/mediasoup/blame/e226f2f9dfcb3124d6a472b051353f75b3959290/node/src/test/test-DataConsumer.ts#L114-L115, shouldn't it be ignored instead of casted / truncated / mod 2**16? Or that's what you mean by "No, we don't want to validate given numbers in TS later. User should be clever enough to know what uint16 means."?

from mediasoup.

ibc avatar ibc commented on May 29, 2024

It means that if user passes a wrong uint16 number it is internally truncated without checking it.

from mediasoup.

piranna avatar piranna commented on May 29, 2024

It means that if user passes a wrong uint16 number it is internally truncated without checking it.

So if it's bigger than 65535, it will be bounded to 65535, isn't it? Or will it be modulo 65536?

from mediasoup.

ibc avatar ibc commented on May 29, 2024

Modulo. 35536 becomes 0 as in the test.

from mediasoup.

piranna avatar piranna commented on May 29, 2024

Great, thanks to confirm :-)

from mediasoup.

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.