Closed sabify closed 1 year ago
Hello,
Thanks for your contribution. However, I am a bit concerned about the introduction of unsafe
code into Phantun. One of the huge advantage of Phantun is that it is written in 100% safe Rust and I am not willing to give it up easily without some good reasoning.
Have you ran any performance benchmark of this change? What is the improvement?
Hello,The multiple udp/tcp connections not compatible single stream tunnel,need set tcp/udp connection to 1.So the default can set to 1.
I'd used unsafe to bypass vectors' boundary check where both vectors' index and size were deterministic, but I just removed them to make it 100% safe code. And for the benchmark, this repository doesn't contain any test suite to benchmark the code and evaluate improvements and regressions. The tests are on yours to get these results, but it is expected that these changes will make it faster. The server code wasn't written to be bidirectional and it could just send or receive one at a time. Also, using faster data structures and removing some unnecessary locks can make huge difference on load.
What's the PR:
connect
,recv_from
will not try to receive packets related to connected sockets)