add audio support, trying to manage MSD device
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user