NetListener::local_address

This commit is contained in:
Dmitry Stepanov
2024-03-19 17:58:54 +03:00
parent 5c46b7ec3d
commit 9675086572
+4
View File
@@ -17,6 +17,10 @@ impl NetListener {
Ok(Self { listener })
}
pub fn local_address(&self) -> io::Result<SocketAddr> {
self.listener.local_addr()
}
pub fn accept_connections(&self) -> Vec<NetStream> {
let mut streams = Vec::new();
while let Ok(result) = self.listener.accept() {