Исправлена гонка записи в сокет
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/pion/webrtc/v4"
|
||||
)
|
||||
@@ -51,7 +50,7 @@ func OnLocalICECandidate(roomID string, peerID string, candidate webrtc.ICECandi
|
||||
buffer.PutUint32(uint32(len([]byte(jsonCandidate))))
|
||||
buffer.PutBytes([]byte(jsonCandidate))
|
||||
buffer.Flip()
|
||||
room.Server.Socket.WriteMessage(websocket.BinaryMessage, buffer.Bytes())
|
||||
room.Server.WriteBinary(buffer.Bytes())
|
||||
}
|
||||
|
||||
// Обработка нового оффера от сервера для конкретного пира (при renegotiation)
|
||||
@@ -73,5 +72,5 @@ func OnServerOffer(roomID string, peerID string, offer webrtc.SessionDescription
|
||||
buffer.PutUint32(uint32(len([]byte(jsonOffer))))
|
||||
buffer.PutBytes([]byte(jsonOffer))
|
||||
buffer.Flip()
|
||||
room.Server.Socket.WriteMessage(websocket.BinaryMessage, buffer.Bytes())
|
||||
room.Server.WriteBinary(buffer.Bytes())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user