From 71f250ad46e9ae0cac108e1de6dc15289da26a56 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Wed, 19 Apr 2017 02:05:42 -0700 Subject: [PATCH] feat(server): add local_addr to retrieve resolved address --- src/server/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/mod.rs b/src/server/mod.rs index ef3ae284e1..5dac5ec5c9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -204,6 +204,11 @@ impl Server { pub fn set_write_timeout(&mut self, dur: Option) { self.listener.set_write_timeout(dur); } + + /// Get the address that the server is listening on. + pub fn local_addr(&mut self) -> io::Result { + self.listener.local_addr() + } } impl Server {