Skip to content

Commit

Permalink
feat(server): add remote_addr method to AddrStream
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Aug 7, 2018
1 parent 4020a2f commit 26f3a5e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ mod addr_stream {
remote_addr: addr,
}
}

/// Returns the remote (peer) address of this connection.
#[inline]
pub fn remote_addr(&self) -> SocketAddr {
self.remote_addr
}
}

impl Read for AddrStream {
Expand Down

0 comments on commit 26f3a5e

Please sign in to comment.