Skip to content

Commit

Permalink
feat(server): add local_addr to retrieve resolved address
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Apr 19, 2017
1 parent 8e2f135 commit 71f250a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ impl<L: NetworkListener> Server<L> {
pub fn set_write_timeout(&mut self, dur: Option<Duration>) {
self.listener.set_write_timeout(dur);
}

/// Get the address that the server is listening on.
pub fn local_addr(&mut self) -> io::Result<SocketAddr> {
self.listener.local_addr()
}
}

impl Server<HttpListener> {
Expand Down

0 comments on commit 71f250a

Please sign in to comment.