Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 824 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 824 Bytes

unix-socket-example

Example repository of a basic unix socket server and client.

This repository demonstrates stream sockets, feel free to contribute a datagram example or add a link to one in this readme. Thanks.

Run the server with:
cargo run -- --server
Open a client connection with:
cargo run -- --client

A handy set of conditions:

  • The client's read socket closes when the server's write socket closes.
  • The server's write socket closes when the server's read socket closes.
  • The server's read socket closes when the the client's write socket closes.

source

References:

https://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html https://doc.rust-lang.org/std/os/unix/net/struct.Incoming.html https://stackoverflow.com/q/40218416/3033813