mirror of
https://github.com/pion/webrtc.git
synced 2025-11-03 09:40:59 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user