unisocket

Crates.iounisocket
lib.rsunisocket
version1.0.0
sourcesrc
created_at2021-08-21 21:42:51.829054
updated_at2021-08-22 23:45:16.331891
descriptionUnified types for TCP & Unix sockets
homepage
repositoryhttps://github.com/xenocorn/unisocket
max_upload_size
id440464
size15,218
fdsdsfgdsfg (xenocorn)

documentation

README

Unisocket

Fork of this library with with minor improvements.

This crate provides unified SocketAddr, Stream and Listener types that work with both TCP and UNIX sockets.

Many applications don't really care whether they are connecting to a UNIX or TCP service, they simply want to use the service. Similarly, applications may want to provide a service over either a UNIX socket or TCP port. The difference between these two socket types matters as much to application logic as the difference between IPv4 and IPv6 - not that much, typically. Yet libstd provides a unified type for IPv4 and IPv6 sockets, but requires a separate type for UNIX sockets. The types provided by this crate allow for writing socket-type-agnostic network applications that treat UNIX sockets in the same way as IPv4 and IPv6: Just a matter of run-time configuration.

These types should behave the same as the SocketAddr, TcpStream/UnixStream and TcpListener/UnixListener in libstd. There is currently no support for mio or tokio.

UDP and Datagram sockets are not currently supported.

On Windows, these types only support TCP and are just lightweight wrappers around TCP sockets.

Commit count: 0

cargo fmt