Skip to content

Commit

Permalink
Merge pull request #1464 from microsoft/enhancement-inetstack-reorg-r…
Browse files Browse the repository at this point in the history
…eceiver

[inetstack] Enhancement: Remove circular dependencies
  • Loading branch information
anandbonde authored Nov 26, 2024
2 parents d866a2a + ba668d6 commit bb1c0ae
Show file tree
Hide file tree
Showing 7 changed files with 668 additions and 831 deletions.
8 changes: 4 additions & 4 deletions src/rust/inetstack/protocols/layer4/tcp/active_open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
constants::{FALLBACK_MSS, MAX_WINDOW_SCALE},
established::{
congestion_control::{self, CongestionControl},
EstablishedSocket,
SharedEstablishedSocket,
},
header::{TcpHeader, TcpOptions2},
SeqNumber,
Expand Down Expand Up @@ -91,7 +91,7 @@ impl SharedActiveOpenSocket {
})))
}

fn process_ack(&mut self, header: TcpHeader) -> Result<EstablishedSocket, Fail> {
fn process_ack(&mut self, header: TcpHeader) -> Result<SharedEstablishedSocket, Fail> {
let expected_seq: SeqNumber = self.local_isn + SeqNumber::from(1);

// Bail if we didn't receive a ACK packet with the right sequence number.
Expand Down Expand Up @@ -191,7 +191,7 @@ impl SharedActiveOpenSocket {
"Window scale: local {}, remote {}",
local_window_scale, remote_window_scale
);
Ok(EstablishedSocket::new(
Ok(SharedEstablishedSocket::new(
self.local,
self.remote,
self.runtime.clone(),
Expand All @@ -212,7 +212,7 @@ impl SharedActiveOpenSocket {
)?)
}

pub async fn connect(mut self) -> Result<EstablishedSocket, Fail> {
pub async fn connect(mut self) -> Result<SharedEstablishedSocket, Fail> {
// Start connection handshake.
let handshake_retries: usize = self.tcp_config.get_handshake_retries();
let handshake_timeout = self.tcp_config.get_handshake_timeout();
Expand Down
Loading

0 comments on commit bb1c0ae

Please sign in to comment.