#tcp #socket

tcp_typed

A wrapper around platform TCP socket APIs that leverages the type system to ensure correct usage. It’s quite easy to accidentally misuse the Berkeley sockets or similar APIs, resulting in ECONNRESET/EPIPE/etc, data being lost on close, and potential hangs from non-exhaustive collection of edge-triggered events. This library aims to make it impossible to misuse in non-unsafe code

5 releases

✓ Uses Rust 2018 edition

0.1.4 Aug 22, 2019
0.1.3 Aug 12, 2019
0.1.2 Jul 24, 2019
0.1.1 Oct 27, 2018
0.1.0 Aug 3, 2018

#467 in Network programming

Download history 56/week @ 2019-12-02 23/week @ 2019-12-09 10/week @ 2019-12-16 8/week @ 2019-12-23 35/week @ 2019-12-30 2/week @ 2020-01-06 53/week @ 2020-01-13 370/week @ 2020-01-20 110/week @ 2020-01-27 263/week @ 2020-02-03 316/week @ 2020-02-10 69/week @ 2020-02-17 120/week @ 2020-02-24 2/week @ 2020-03-02 42/week @ 2020-03-09 10/week @ 2020-03-16

262 downloads per month
Used in 3 crates (2 directly)

MIT/Apache

57KB
2K SLoC

tcp_typed

Crates.io MIT / Apache 2.0 licensed Build Status

Docs

A wrapper around platform TCP socket APIs that leverages the type system to ensure correct usage.

It's quite easy to accidentally misuse the Berkeley sockets or similar APIs, resulting in ECONNRESET/EPIPE/etc, data being lost on close, and potential hangs from non-exhaustive collection of events given edge-triggered notifications.

This library aims to make it impossible to misuse in non-unsafe code.

If you ever see a connection reset / ECONNRESET, EPIPE, data being lost on close, or panic, then it is a bug in this library! Please file an issue with as much info as possible.

It's designed to be used in conjunction with an implementer of the Notifier trait – for example notifier. As long as the Notifier contract is fulfilled, then this library will collect all relevent events (connected, data in, data available to be written, remote closed, bytes acked, connection errors) upon each edge-triggered notification.

Note

Currently doesn't support Windows.

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.9–1.4MB
~29K SLoC