From e8160eda1b68a42b8d861bbec5e9c1dc555ea783 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 26 Sep 2025 17:15:06 +0800 Subject: feat(tcp_connection): add MessagePack serialization support - Add rmp-serde dependency for MessagePack serialization - Implement write_msgpack and read_msgpack methods for basic MessagePack support - Add write_large_msgpack and read_large_msgpack methods for chunked transmission - Add error conversions for rmp-serde errors - Add comprehensive tests for MessagePack functionality - Fix code formatting and improve readability - Make stream field pub(crate) for better access control All tests pass successfully, ensuring backward compatibility. --- crates/utils/tcp_connection/src/target_connection.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/utils/tcp_connection/src/target_connection.rs') diff --git a/crates/utils/tcp_connection/src/target_connection.rs b/crates/utils/tcp_connection/src/target_connection.rs index 87fd1ab..0462f7b 100644 --- a/crates/utils/tcp_connection/src/target_connection.rs +++ b/crates/utils/tcp_connection/src/target_connection.rs @@ -17,7 +17,10 @@ where Server: ServerHandle, { /// Attempts to establish a connection to the TCP server. - /// This function initiates a connection to the server address specified in the target configuration. + /// + /// This function initiates a connection to the server address + /// specified in the target configuration. + /// /// This is a Block operation. pub async fn connect(&self) -> Result<(), TcpTargetError> { let addr = self.get_addr(); @@ -37,7 +40,9 @@ where } /// Attempts to establish a connection to the TCP server. - /// This function initiates a connection to the server address specified in the target configuration. + /// + /// This function initiates a connection to the server address + /// specified in the target configuration. pub async fn listen(&self) -> Result<(), TcpTargetError> { let addr = self.get_addr(); let listener = match TcpListener::bind(addr).await { -- cgit