Source File
iceconnectionstate.go
Belonging Package
github.com/pion/webrtc/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage webrtc// ICEConnectionState indicates signaling state of the ICE Connection.type ICEConnectionState intconst (// ICEConnectionStateUnknown is the enum's zero-value.ICEConnectionStateUnknown ICEConnectionState = iota// ICEConnectionStateNew indicates that any of the ICETransports are// in the "new" state and none of them are in the "checking", "disconnected"// or "failed" state, or all ICETransports are in the "closed" state, or// there are no transports.ICEConnectionStateNew// ICEConnectionStateChecking indicates that any of the ICETransports// are in the "checking" state and none of them are in the "disconnected"// or "failed" state.ICEConnectionStateChecking// ICEConnectionStateConnected indicates that all ICETransports are// in the "connected", "completed" or "closed" state and at least one of// them is in the "connected" state.ICEConnectionStateConnected// ICEConnectionStateCompleted indicates that all ICETransports are// in the "completed" or "closed" state and at least one of them is in the// "completed" state.ICEConnectionStateCompleted// ICEConnectionStateDisconnected indicates that any of the// ICETransports are in the "disconnected" state and none of them are// in the "failed" state.ICEConnectionStateDisconnected// ICEConnectionStateFailed indicates that any of the ICETransports// are in the "failed" state.ICEConnectionStateFailed// ICEConnectionStateClosed indicates that the PeerConnection's// isClosed is true.ICEConnectionStateClosed)// This is done this way because of a linter.const (iceConnectionStateNewStr = "new"iceConnectionStateCheckingStr = "checking"iceConnectionStateConnectedStr = "connected"iceConnectionStateCompletedStr = "completed"iceConnectionStateDisconnectedStr = "disconnected"iceConnectionStateFailedStr = "failed"iceConnectionStateClosedStr = "closed")// NewICEConnectionState takes a string and converts it to ICEConnectionState.func ( string) ICEConnectionState {switch {case iceConnectionStateNewStr:return ICEConnectionStateNewcase iceConnectionStateCheckingStr:return ICEConnectionStateCheckingcase iceConnectionStateConnectedStr:return ICEConnectionStateConnectedcase iceConnectionStateCompletedStr:return ICEConnectionStateCompletedcase iceConnectionStateDisconnectedStr:return ICEConnectionStateDisconnectedcase iceConnectionStateFailedStr:return ICEConnectionStateFailedcase iceConnectionStateClosedStr:return ICEConnectionStateCloseddefault:return ICEConnectionStateUnknown}}func ( ICEConnectionState) () string {switch {case ICEConnectionStateNew:return iceConnectionStateNewStrcase ICEConnectionStateChecking:return iceConnectionStateCheckingStrcase ICEConnectionStateConnected:return iceConnectionStateConnectedStrcase ICEConnectionStateCompleted:return iceConnectionStateCompletedStrcase ICEConnectionStateDisconnected:return iceConnectionStateDisconnectedStrcase ICEConnectionStateFailed:return iceConnectionStateFailedStrcase ICEConnectionStateClosed:return iceConnectionStateClosedStrdefault:return ErrUnknownType.Error()}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |