mirror of
https://github.com/unitoftime/rtcnet.git
synced 2025-09-26 20:31:17 +08:00
Close the websocket connection once the webrtc connection is established
This commit is contained in:
1
dial.go
1
dial.go
@@ -15,6 +15,7 @@ func Dial(address string, tlsConfig *tls.Config) (*Conn, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer wSock.Close()
|
||||
|
||||
// Offer WebRtc Upgrade
|
||||
var candidatesMux sync.Mutex
|
||||
|
@@ -145,7 +145,7 @@ func (l *Listener) attemptWebRtcNegotiation(wsConn net.Conn) {
|
||||
// Register channel opening handling
|
||||
d.OnOpen(func() {
|
||||
printDataChannel(d)
|
||||
|
||||
wsConn.Close()
|
||||
l.pendingAccepts <- conn
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user