DataChannels: OpenChannel & OnOpen

- OpenChannel messages are now sent after SCTP is Established.
- The OnOpen handler tells the application when a channel has opened.

Relates to #159
This commit is contained in:
backkem
2018-09-25 22:04:48 +02:00
committed by Sean DuBois
parent 553858050e
commit 0043a4bf9a
7 changed files with 138 additions and 90 deletions

View File

@@ -45,13 +45,6 @@ func buildPeerConnection() *webrtc.RTCPeerConnection {
peerConnection.OnICEConnectionStateChange = func(connectionState ice.ConnectionState) {
fmt.Printf("Connection State has changed %s \n", connectionState.String())
if connectionState == ice.ConnectionStateConnected {
fmt.Println("sending openchannel")
err := d.SendOpenChannelMessage()
if err != nil {
fmt.Println("faild to send openchannel", err)
}
}
}
return peerConnection