Feature(Go): Screen frame relay end-to-end with graceful client BYE (Phase 4)

This commit is contained in:
yuanyuanxiang
2026-05-18 01:00:56 +02:00
committed by yuanyuanxiang
parent 4ea6ed252c
commit fba4143dd1
10 changed files with 999 additions and 74 deletions

View File

@@ -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(),