[−][src]Module spirit_tokio::net::limits
Handling limits and errors on listening sockets.
„Naked“ listening sockets have two important problems:
- They sometimes return errors when accepting, which often terminates the stream. Most of these are actually recoverable error in practice, so the termination seldom makes sense.
- They have no limit on how many active connections they have spawned, allowing the application to grow without limits and eat all OS resources.
This module provides tools to address these problems in the form of WithListenLimits
wrapper. There are also type aliases for already wrapped sockets, like TcpListenWithLimits
Structs
Limited | Wrapper around a listener instance. |
Limits | An implementation of |
Tracked | One connection accepted through the |
WithListenLimits | A wrapper around a listening socket |
Traits
ListenLimits | Additional configuration for limiting of connections & error handling when accepting. |
Type Definitions
WithLimits | A convenience type alias for the default |