Skip to content

Commit

Permalink
enable TCP_NODELAY for rust client channel
Browse files Browse the repository at this point in the history
  • Loading branch information
OmmyZhang committed Sep 26, 2023
1 parent bc9c04d commit 4bb315c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rs/src/transport/socket.rs
Expand Up @@ -52,6 +52,7 @@ use crate::{new_transport_error, TransportErrorKind};
/// use thrift::transport::TTcpChannel;
///
/// let stream = TcpStream::connect("127.0.0.1:9189").unwrap();
/// stream.set_nodelay(true).unwrap();
///
/// // no need to call c.open() since we've already connected above
/// let mut c = TTcpChannel::with_stream(stream);
Expand Down Expand Up @@ -94,6 +95,7 @@ impl TTcpChannel {
} else {
match TcpStream::connect(&remote_address) {
Ok(s) => {
s.set_nodelay(true)?;
self.stream = Some(s);
Ok(())
}
Expand Down

0 comments on commit 4bb315c

Please sign in to comment.