add audio support, trying to manage MSD device

This commit is contained in:
Artem
2024-11-03 11:44:40 +01:00
parent 68ba48a3a2
commit 1b60f43df1
22 changed files with 1059 additions and 263 deletions

View File

@@ -2,6 +2,7 @@ package ws
import (
"encoding/json"
"net"
"net/http"
"rkkvm/config"
"rkkvm/http/hw/hid"
@@ -47,6 +48,17 @@ func ConnHandler(c *gin.Context) {
}
log.Debugf("websocket connected")
// Get the underlying net.Conn from the WebSocket connection
netConn := conn.UnderlyingConn()
// Enable TCP_NODELAY
if tcpConn, ok := netConn.(*net.TCPConn); ok {
if err := tcpConn.SetNoDelay(true); err != nil {
log.Println("Failed to set TCP_NODELAY:", err)
return
}
}
cl := &client{
hid: hid.GetHid(),
conn: conn,