paullouisageneau / libjuice

JUICE is a UDP Interactive Connectivity Establishment library
Mozilla Public License 2.0
426 stars 80 forks source link

How should JUICE_STATE_CONNECTED and JUICE_STATE_COMPLETED be understood? #174

Closed fengshangren closed 2 years ago

fengshangren commented 2 years ago

How should JUICE_STATE_CONNECTED and JUICE_STATE_COMPLETED be understood?

fengshangren commented 2 years ago

Let me ask you how to understand juice_set_remote_gathering_done, I don’t know what this does.

fengshangren commented 2 years ago

Make a suggestion, cb_gathering_done will not trigger for a long time, you can shorten the trigger time

paullouisageneau commented 2 years ago

How should JUICE_STATE_CONNECTED and JUICE_STATE_COMPLETED be understood?

They are not specific to libjuice and represent the ICE state (it's similar to iceConnectionState for WebRTC for instance):

Let me ask you how to understand juice_set_remote_gathering_done, I don’t know what this does.

This is an optional call to indicate to the local agent that the remote gathering is done and therefore there are no more remote candidates (it means the gathering_done callback has been called on the remote side). By default, if all connectivity checks fail, libjuice still waits for new remote candidates and will fail only after a timeout. If you call this method, it will fail immediately as it knows there are no more remote candidates to wait for.

Make a suggestion, cb_gathering_done will not trigger for a long time, you can shorten the trigger time

It means one of the servers you use is down and therefore libjuice has to wait for a timeout. You should fix the server. If you used stun.ageneau.net despite the recommendation not to use it outside of libjuice tests, it's now offline because people used in for production traffic (see https://github.com/paullouisageneau/libdatachannel/issues/717), you need to change to another server.

fengshangren commented 2 years ago

Thanks, I fully understand