Code Monkey home page Code Monkey logo

Comments (6)

paullouisageneau avatar paullouisageneau commented on August 31, 2024

The mid is the media ID the candidate corresponds to, and it should travel with it though the signaling channel. The equivalent field in the Javascript API is sdpMid and it's mandatory.

It's mostly here because it is part of WebRTC signaling but actually ignored by libdatachannel. You can safely put an empty string there.

from libdatachannel.

stevedanomodolor avatar stevedanomodolor commented on August 31, 2024

Thank you for the advise you gave me, it workerd.
Does this api exist in c

std::optional<std::chrono::milliseconds> rtt = pc->rtt();
if (pc->getSelectedCandidatePair(&local, &remote)) {
    cout << "Local: " << local.address << ":" << local.port << " " << local.type << " " << local.transportType << endl;
    cout << "Remote: " << remote.address << ":" << remote.port << " " << remote.type << " " << remote.transportType << endl;
    cout << "Bytes Sent:" << pc->bytesSent() << " / Bytes Received:" << pc->bytesReceived() << " / Round-Trip Time:";
    if (rtt.has_value())
        cout << rtt.value().count();
    else
        cout << "null";
    cout << " ms";
} 

from libdatachannel.

paullouisageneau avatar paullouisageneau commented on August 31, 2024

Not exactly, however you can use rtcGetLocalAddress(int pc, char *buffer, int size) and
rtcGetRemoteAddress(int pc, char *buffer, int size) to get both addresses.

from libdatachannel.

stevedanomodolor avatar stevedanomodolor commented on August 31, 2024

I just wrote a version in c, if you want i can post it?, I am fairly new to programming so it might not be perfect.
Also, the p2p does not use any signal server, how to do you do the sending of the initial information using the signalling server using c?, said another way, how do you communicate the sdp, candidate information to the server from the c code?

from libdatachannel.

paullouisageneau avatar paullouisageneau commented on August 31, 2024

Yes sure, please open a pull request.
For now you can submit it with the copy/paste instead of a signaling. As you might have seen, I opened a pull request to add websocket support, it can be used to send the SDP and candidates to a signaling server.

from libdatachannel.

paullouisageneau avatar paullouisageneau commented on August 31, 2024

Done in #65

from libdatachannel.

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.