-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usage clarification #204
Comments
You can do both: either you call it before gathering, then you have to send candidates to the remote agent, or you call it when gathering is done, then you only need to send the description (see the
Yes you can, the library will detect a role conflit and resolve it, as both agents initiate the connection. Protocols relying on ICE (SIP, WebRTC, etc) typically have a form of offer/answer as one peer always calls the other one.
No, only once.
You should call it as soon as possible, there is no reason to delay it. However, you can call
You must use
None!
If you create multiple agents in the same program, there are of course differences in terms of performance and resource usage. Otherwise, |
Thanks for such detailed answer. I have some followup questions:
I appreciate your help again ;) |
It would break compatibility with the ICE protocol and it feels a bit hacky, but if you use a modified libjuice on both sides and don't use TURN it could work.
This does not work in general as the local selected address is the local address seen by the remote peer, which will often be a NAT public-facing address. There is absolutely no guarantee that the socket is bound to the same port in the case of NAT traversal. Also, destroying the agent does not send any packet but you may lose incoming packets and the other peer might receive ICMP port unreachable messages, since you can't extract the socket synchronously on both sides. I don't recommend doing that.
Any UDP packet will keep the path alive. ICE agents require the remote agent to answer their consent refresh requests even after connection otherwise they may time out.
Yes they do.
All these situations should typically connect fine, only mobile to mobile is expected to often fail (the situation where P2P connection is impossible is when both peers are behind endpoint-dependent NATs, aka "symmetric" NATs, which mobile ISPs often use). Check the STUN server is reachable, that all candidates are transmitted properly (there should be a "srflx" one), and that descriptions are exchanged fast enough (the whole exchange must take less than 10s or so). |
Thanks again for all the answers!! ;) I have few more questions, please, bear with me ;)
Your answers are greatly appreciated. Thanks. |
It doesn't add additional bytes except when relaying through a TURN server (in this case it adds 4 bytes). The data is indeed always considered as binary and unchanged.
Yes they are called in the same thread. The thread is either shared between connections with concurrency modes
I think Google STUN servers are primarily there for Google products and developers ended up using them as a free service, but without any form of SLA. As far as I know there is no guarantee, Google could decide to change them or put them offline at some point. Additionally, the servers are blacklisted in China, which can be an issue. I'd recommend that you use your own server.
No, clients can use different STUN servers. |
Several questions on how to use the library (as an agent only):
When do I call juice_get_local_description? Can I call it immediately after juice_create or should I give the agent some time for connecting to the stun server?
Can I call juice_get_local_description on both agents before calling any juice_set_remote_description? Or do I always have to wait with one agent to receive description from the first agent?
Can or should I call juice_set_remote_description repeatedly on same agent? Should I repeatedly exchange descriptions between agents?
When do I call juice_gather_candidates? Do I always call it immediately after first juice_set_remote_description, or are there any reasons to delay it or not to call it?
After the agent is completed, do I have to use juice_send for my connection, or can I use juice_get_selected_addresses and create new socket for my communication?
Which, if any, juice functions block?
Are there any observable differences for me for using different concurrency models?
Thanks for your help ;)
The text was updated successfully, but these errors were encountered: