containerd / ttrpc-rust

Rust implementation of ttrpc (GRPC for low-memory environments)
Apache License 2.0
195 stars 45 forks source link

There is a problem in unix abstract domain socket's implementation #98

Closed Tim-Zhang closed 3 years ago

Tim-Zhang commented 3 years ago

Start the server

$cargo run --example server

Show the socket

tim@k:~/project/ttrpc-rust/example$ netstat -an|grep /tmp/1
unix  2      [ ACC ]     STREAM     LISTENING     107020596 @/tmp/1@

We can see the @/tmp/1@ has a redundant suffix @, and this server can not be connected by a normal client(the client in our example has the suffix too, so there is no problem with it)

And the problem caused by: https://github.com/containerd/ttrpc-rust/blob/3f93cd63d4b0953ae23a8e66bda9673d7f658bfa/src/common.rs#L82