浏览代码

communicator: enable nodelay for tcp streams

Lennart Braun 2 年之前
父节点
当前提交
d079eb6bef
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      communicator/src/tcp.rs

+ 3 - 0
communicator/src/tcp.rs

@@ -175,6 +175,9 @@ pub fn make_tcp_communicator(
 ) -> Result<impl AbstractCommunicator, Error> {
     // create connections with other parties
     let stream_map = setup_connection(num_parties, my_id, options)?;
+    stream_map
+        .iter()
+        .for_each(|(_, s)| s.set_nodelay(true).expect("set_nodelay failed"));
     // use streams as reader/writer pairs
     let rw_map = stream_map
         .into_iter()