GithubHelp home page GithubHelp logo

Comments (1)

ibc avatar ibc commented on May 29, 2024

Usage of uv_async stuff should be easy:

  1. The SctpAssociation class should have a new uv_async_t* uvAsyncHandle private member.
  2. The SctpAssociation class should have a new public getter uv_async_t* GetAsyncHandle() method that returns this->uvAsyncHandle.
  3. The SctpAssociation should expose a public method InitializeSyncHandle(uv_async_cb callback) which internally should call uv_async_init(DepLibUV::GetLoop(), this->uvAsyncHandle, callback).
  4. We store each SctpAssociation in the existing DepUsrSCTP::mapIdSctpAssociation map (nothing new here).
  5. In addition to that, DepUsrSCTP::RegisterSctpAssociation should call sctpAssociation->InitializeSyncHandle(static_cast<uv_async_cb>(xxxx)) where xxxx is a uv_async_cb callback that somehow runs the mutex to read data and len in a new map associated to the StcpAssociation and calls sctpAssociation->OnUsrSctpSendSctpData(data, len) and then remove that entry from that map. Or similar.
  6. The onSendSctpData() static function, once it retrieves the associated SctpAssociation, should call auto* uvAsyncHandle = GetAsyncHandle() on it, and then invoke uv_async_send(uvAsyncHandle).
  7. But this should only be done in Rust since in Node it's not needed at all.

That's all. Then something similar should be done in ClassInit() to initialize usrsctp and the Checker singleton within the thread X.

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.