Remove SnowflakeDataChannel interface.

Use *webrtc.DataChannel directly.
This commit is contained in:
David Fifield 2020-04-24 14:41:19 -06:00
parent 32207d6f06
commit 8caa737700
2 changed files with 2 additions and 9 deletions

View file

@ -1,7 +1,6 @@
package lib
import (
"io"
"net"
)
@ -30,9 +29,3 @@ type SocksConnector interface {
Reject() error
net.Conn
}
// Interface for the Snowflake's transport. (Typically just webrtc.DataChannel)
type SnowflakeDataChannel interface {
io.Closer
Send([]byte) error
}

View file

@ -21,7 +21,7 @@ type WebRTCPeer struct {
id string
config *webrtc.Configuration
pc *webrtc.PeerConnection
transport SnowflakeDataChannel // Holds the WebRTC DataChannel.
transport *webrtc.DataChannel
broker *BrokerChannel
offerChannel chan *webrtc.SessionDescription
@ -321,7 +321,7 @@ func (c *WebRTCPeer) cleanup() {
if c.pc == nil {
panic("DataChannel w/o PeerConnection, not good.")
}
dataChannel.(*webrtc.DataChannel).Close()
dataChannel.Close()
} else {
c.lock.Unlock()
}