meh / rust-tun

TUN device creation and handling.
343 stars 136 forks source link

How do I send a packet while receiving? #11

Closed vi closed 4 years ago

vi commented 5 years ago

How do I do full-duplex communication using Device without using AsRawFd, just with std::io::Read and std::io::Write?

Maybe Device should have try_clone(), so both copies can be sent to separate threads?

kings-way commented 4 years ago

@vi Check this pub fn split(self) -> (Reader, Writer) (https://docs.rs/tun/0.4.4/tun/platform/struct.Device.html#method.split)