paritytech / parity-tokio-ipc

Parity tokio-ipc
Apache License 2.0
76 stars 48 forks source link

Add support for construct Connection and Endpoint from raw file descr… #25

Closed Tim-Zhang closed 4 years ago

Tim-Zhang commented 4 years ago

Add support for construct Connection and Endpoint from raw file descriptor.

User can use from_raw_fd to increase flexibility, e.g. use nix instead of libc to support abstract domain socket.

Signed-off-by: Tim Zhang tim@hyper.sh

NikVolf commented 4 years ago

Thanks! Please, in general, avoid reformatting of the code in the same pr and submit only actual changes.

Why do you need this api here?

Tim-Zhang commented 4 years ago

Hi @NikVolf , I have already removed the formatting codes. We need abstract namespace socket which rust does not support for now. Through this api we could use a raw-fd created by nix to create Connection and Endpoint.

For more information please read examples/server-rawfd and examples/client-rawfd

Thanks

NikVolf commented 4 years ago

@Tim-Zhang But if you using only unix sockets, you don't need this lib, do you?

Otherwise can you provide an example how this is supposed to work on both windows and *nix ?

Tim-Zhang commented 4 years ago

Ah, you remind me! as our codes changing, we do not need this lib any more. sorry to interrupt, I should close the pull request.