Skip to content

Commit

Permalink
feat(server): add server::conn::AddrIncoming::bind constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Dec 11, 2018
1 parent 3287a0c commit 2d5eabd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ impl AddrIncoming {
})
}

/// Creates a new `AddrIncoming` binding to provided socket address.
pub fn bind(addr: &SocketAddr) -> ::Result<Self> {
AddrIncoming::new(addr, None)
}

/// Get the local address bound to this listener.
pub fn local_addr(&self) -> SocketAddr {
self.addr
Expand Down

0 comments on commit 2d5eabd

Please sign in to comment.