Feature(Go): Screen frame relay end-to-end with graceful client BYE (Phase 4)
This commit is contained in:
@@ -86,6 +86,15 @@ const (
|
||||
// NewContext creates a new connection context
|
||||
func NewContext(conn net.Conn, mgr *Manager) *Context {
|
||||
now := time.Now()
|
||||
// Disable Nagle's algorithm. The protocol mixes tiny acks (ConnAuth,
|
||||
// HeartbeatAck, CMD_MASTERSETTING) with large frame bursts; with Nagle
|
||||
// on, those acks sit in the kernel buffer up to ~200 ms waiting for
|
||||
// more bytes, and combined with the peer's delayed-ACK that's enough
|
||||
// to make the screen handshake feel sluggish vs. the C++ server (which
|
||||
// sets TCP_NODELAY on every sub-context in ScreenSpyDlg).
|
||||
if tcp, ok := conn.(*net.TCPConn); ok {
|
||||
_ = tcp.SetNoDelay(true)
|
||||
}
|
||||
ctx := &Context{
|
||||
Conn: conn,
|
||||
RemoteAddr: conn.RemoteAddr().String(),
|
||||
|
||||
Reference in New Issue
Block a user