Skip to content

Commit 43086cd

Browse files
Added public port field to WitcherConnection
1 parent c2e7b3a commit 43086cd

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

crates/net/src/connection.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use crate::protocol::*;
77

88
#[derive(Debug)]
99
pub struct WitcherConnection {
10-
stream: TcpStream
10+
stream: TcpStream,
11+
pub port: WitcherPort
1112
}
1213

1314
impl WitcherConnection {
@@ -22,7 +23,8 @@ impl WitcherConnection {
2223
stream.set_read_timeout(Some(std::time::Duration::from_millis(Self::DEFAULT_READ_TIMEOUT_MILLIS)))?;
2324

2425
Ok(Self {
25-
stream
26+
stream,
27+
port
2628
})
2729
}
2830

@@ -32,15 +34,17 @@ impl WitcherConnection {
3234
stream.set_read_timeout(Some(std::time::Duration::from_millis(Self::DEFAULT_READ_TIMEOUT_MILLIS)))?;
3335

3436
Ok(Self {
35-
stream
37+
stream,
38+
port
3639
})
3740
}
3841

3942
pub fn try_clone(&self) -> anyhow::Result<Self> {
4043
let cloned_stream = self.stream.try_clone()?;
4144

4245
Ok(Self {
43-
stream: cloned_stream
46+
stream: cloned_stream,
47+
port: self.port.clone()
4448
})
4549
}
4650

0 commit comments

Comments
 (0)