tweaks to tcpproxy example

This commit is contained in:
mfahampshire
2025-06-18 18:27:09 +02:00
parent 7b2f8a4ed1
commit 3cb17e76bd
3 changed files with 5 additions and 5 deletions
@@ -196,7 +196,6 @@ impl InputMessage {
self.set_max_retransmissions(max_retransmissions);
self
}
}
pub fn serialized_size(&self) -> u64 {
bincode::serialized_size(self).expect("failed to get serialized InputMessage size") + 4
+4 -3
View File
@@ -9,6 +9,7 @@ use futures::{ready, FutureExt, Sink, SinkExt, Stream, StreamExt};
use log::{debug, error};
use nym_client_core::client::base_client::GatewayConnection;
use nym_client_core::client::inbound_messages::InputMessageCodec;
use nym_client_core::client::mix_traffic::ClientRequestSender;
use nym_client_core::client::{
base_client::{ClientInput, ClientOutput, ClientState},
inbound_messages::InputMessage,
@@ -24,15 +25,15 @@ use nym_statistics_common::clients::{ClientStatsEvents, ClientStatsSender};
use nym_task::connections::{ConnectionCommandSender, LaneQueueLengths};
use nym_task::ShutdownTracker;
use nym_topology::{NymRouteProvider, NymTopology};
use std::pin::Pin;
use std::pin::{pin, Pin};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::task::{Context, Poll};
use std::time::Duration;
use tokio::io::{AsyncRead, ReadBuf};
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
use tokio::sync::RwLockReadGuard;
use tokio_util::codec::{Encoder, FramedWrite};
use tokio_util::sync::CancellationToken;
use tokio_util::codec::{Encoder, FramedRead, FramedWrite};
/// Client connected to the Nym mixnet.
pub struct MixnetClient {
+1 -1
View File
@@ -163,7 +163,7 @@
//! let codec = BytesCodec::new();
//! let mut framed_read = FramedRead::new(read, codec);
//! // Much like the tcpstream, split our Nym client into a sender and receiver for concurrent read/write
//! let sender = client.split_sender();
//! let mut sender = client.split_sender();
//! // The server / service provider address our client is sending messages to will remain static
//! let server_addr = server_address;
//! // Store outgoing messages in instance of Dashset abstraction