Mercurial > crates > systemd-socket
diff README.md @ 4:66c0e10c89fc
Support resolving hostnames
Until now the crate supported only IP addresses and systemd sockets.
This was troublesome because it prevented the popular `localhost:1234`
format. This commit changes the behavior so that if parsing of
`std::net::SocketAddr` fails it attempts to parse it as `hostname:port`.
`bind_*()` methods were also modified to be async because of this.
author | Martin Habovstiak <martin.habovstiak@gmail.com> |
---|---|
date | Fri, 27 Nov 2020 15:05:19 +0100 |
parents | 0edcde404b02 |
children | a7893294e9b2 |
line wrap: on
line diff
--- a/README.md Fri Nov 27 12:56:37 2020 +0100 +++ b/README.md Fri Nov 27 15:05:19 2020 +0100 @@ -13,7 +13,8 @@ Thanks to this the change to your code should be minimal - parsing will continue to work, it'll just allow a new format. You only need to change the code to use `SocketAddr::bind()` instead of `TcpListener::bind()` for binding. -Further, the crate also provides convenience methods for binding `tokio` 0.2, 0.3, and `async_std` sockets. +Further, the crate also provides methods for binding `tokio` 0.2, 0.3, and `async_std` sockets if the appropriate features are +activated. ## Example @@ -42,9 +43,9 @@ * `serde` - implements `serde::Deserialize` for `SocketAddr` * `parse_arg` - implements `parse_arg::ParseArg` for `SocketAddr` -* `tokio_0_2` - adds `bind_tokio_0_2` convenience method to `SocketAddr` -* `tokio_0_3` - adds `bind_tokio_0_3` convenience method to `SocketAddr` -* `async_std` - adds `bind_async_std` convenience method to `SocketAddr` +* `tokio_0_2` - adds `bind_tokio_0_2` method to `SocketAddr` +* `tokio_0_3` - adds `bind_tokio_0_3` method to `SocketAddr` +* `async_std` - adds `bind_async_std` method to `SocketAddr` ## MSRV