Skip to content

Commit

Permalink
force control channel for nodelay
Browse files Browse the repository at this point in the history
  • Loading branch information
shraiton authored and Musixal committed Nov 26, 2024
1 parent ae2b478 commit 45fdd76
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/server/transport/tcpmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ func (s *TcpMuxTransport) channelHandshake() {
continue
}

//FORCE CONTROL CHANNEL TO BE TCP_NODELAY
tcpConn, ok := conn.(*net.TCPConn)
if !ok {
conn.Close()
continue
}
if err := tcpConn.SetNoDelay(true); err != nil {
s.logger.Warnf("failed to set TCP_NODELAY for Control Channel %s: %v", tcpConn.RemoteAddr().String(), err)
}

s.controlChannel = conn

s.logger.Info("control channel successfully established.")
Expand Down

0 comments on commit 45fdd76

Please sign in to comment.