-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Implement ICE-TCP #293
base: master
Are you sure you want to change the base?
Implement ICE-TCP #293
Conversation
2e10e4d
to
eba7075
Compare
@paullouisageneau Looking at the different modes conn types (Poll/Thread/Mux) it seems unlikely I would succeed putting the concept of TCP into them. Should I create something multi-threaded that does TCP as its own thread/struct? |
OK, this is complicated because the whole library is designed with the assumption that candidates can only be UDP. It would be way simpler to implement TURN TCP. I think you can't realistically implement something on the side running in its own thread. It seems to me the best way to implement this is to add optional TCP sockets for each agent to the thread and poll connectivity backends (I don't think mux mode can have TCP candidates as you would have to create new sockets). TCP sockets would be polled and read by the backend. A lot of functions assume addresses are UDP only, like You would then need to modify the logic to match candidates pairs properly. You would probably need to introduce a function to order the backend to actively connect to a remote TCP address. Again, this is complicated and requires fundamental changes, contrary to TURN TCP (as candidates are still UDP in that case). |
include/juice/juice.h
Outdated
typedef enum juice_ice_tcp_mode { | ||
JUICE_ICE_TCP_MODE_NONE = 0, // ICE-TCP is disabled | ||
JUICE_ICE_TCP_MODE_ACTIVE, // ICE-TCP will operate as a client | ||
JUICE_ICE_TCP_MODE_PASSIVE, // ICE-TCP will operate as a server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand TCP candidates are not exclusive. An agent may gather both active, passive (and possibly simultaneous open) candidates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can be! I believe browsers only do active TCP. They don't accept inbound TCP connections.
Requiring users to run TURN servers would make for a worse ecosystem. It wouldn't be fatal, but I would have regret for pushing the complexity onto everyone. Many WebRTC implementations don't support adding TURN servers after the If we do ICE-TCP users don't have to run additional TURN servers with all the extra infrastructure needed to make it work. I hope you think that's a good enough justification to add this to lib juice. |
This is going to take me a while, but I wanted to check in before I started!
I am going to implement both active + passive. My reasoning is I want to be able to test it E2E.
I don't have any hard ideas/opinions on how it should be implemented. Do you have any advice as I learn the code base?