tuntox
tuntox copied to clipboard
make UDP connections more likely
by removing the start_port and end_port the connection more often uses UDP and is much faster. with those lines i always only get TCP relayed connections.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities (and
0 Security Hotspots to review)
0 Code Smells
https://github.com/gjedeer/tuntox/blob/3196377fe33d6a23f22fb47ed4f2b174e370d086/main.c#L1476
also this line means that you will RUN a tcp relay (which you may not want), it has nothing to do with using TCP relays. if you set the value to 0 then you will NOT run a tcp relay. something you may want to allow in the options
also this line means that you will RUN a tcp relay
Yes, I'm aware. If --help
is not clear about it, your suggestion on different wording is welcome.
I wanted to help the network by making more TCP relays available, but it doesn't seem that any kind of gossip protocol about relays is even in the roadmap, so it makes no sense because all Tox clients are using hard coded relays anyway.
by removing the start_port and end_port the connection more often uses UDP and is much faster.
I did not know that. I still want to retain the ability for users to specify which UDP ports to use (because of port forwarding) so I'm definitely not going to merge your PR as is, but perhaps it's a good idea to stick with defaults instead of random values. Thanks.
https://github.com/TokTok/c-toxcore/blob/master/toxcore/tox.h#L610-L611
If both start_port and end_port are 0, the default port range will be
used: [33445, 33545].