-
Notifications
You must be signed in to change notification settings - Fork 26
implement TryFrom<std::net::UdpSocket/TcpListener> for UdpSocket/TcpListener #99
base: master
Are you sure you want to change the base?
Conversation
TryFrom is implemented for std::net::{UdpSocket, TcpListener} respectively. This allows setting various socket options (e.g. SO_REUSEPORT) before binding to the socket, and also socket passing from the service supervisor (e.g. systemd).
Hey thanks so much for this patch! For work we encountered a similar situation recently (around mio also), and something that came out of it is that if a Which is to say: I think it'd be entirely reasonable to use |
Let the user fail as they want =) |
It will probably be okay, but I didn't feel confident burying |
Just to clarify - the "👍" means "it's ok to keep it as it is", "please change it to |
I am against .unwrap() in a library code |
@vavrusa yeah, I'd prefer if it was @kpp Sorry, but that feels like an arbitrary restriction. If we were to follow that then |
It's not. You can add both |
a989815
to
617f76d
Compare
This allows setting various socket options (e.g. SO_REUSEPORT) before
binding to the socket, and also socket passing from the service supervisor (e.g. systemd).