Source File
icetransportstate.go
Belonging Package
github.com/pion/webrtc/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage webrtcimport// ICETransportState represents the current state of the ICE transport.type ICETransportState intconst (// ICETransportStateUnknown is the enum's zero-value.ICETransportStateUnknown ICETransportState = iota// ICETransportStateNew indicates the ICETransport is waiting// for remote candidates to be supplied.ICETransportStateNew// ICETransportStateChecking indicates the ICETransport has// received at least one remote candidate, and a local and remote// ICECandidateComplete dictionary was not added as the last candidate.ICETransportStateChecking// ICETransportStateConnected indicates the ICETransport has// received a response to an outgoing connectivity check, or has// received incoming DTLS/media after a successful response to an// incoming connectivity check, but is still checking other candidate// pairs to see if there is a better connection.ICETransportStateConnected// ICETransportStateCompleted indicates the ICETransport tested// all appropriate candidate pairs and at least one functioning// candidate pair has been found.ICETransportStateCompleted// ICETransportStateFailed indicates the ICETransport the last// candidate was added and all appropriate candidate pairs have either// failed connectivity checks or have lost consent.ICETransportStateFailed// ICETransportStateDisconnected indicates the ICETransport has received// at least one local and remote candidate, but the final candidate was// received yet and all appropriate candidate pairs thus far have been// tested and failed.ICETransportStateDisconnected// ICETransportStateClosed indicates the ICETransport has shut down// and is no longer responding to STUN requests.ICETransportStateClosed)const (iceTransportStateNewStr = "new"iceTransportStateCheckingStr = "checking"iceTransportStateConnectedStr = "connected"iceTransportStateCompletedStr = "completed"iceTransportStateFailedStr = "failed"iceTransportStateDisconnectedStr = "disconnected"iceTransportStateClosedStr = "closed")func newICETransportState( string) ICETransportState {switch {case iceTransportStateNewStr:return ICETransportStateNewcase iceTransportStateCheckingStr:return ICETransportStateCheckingcase iceTransportStateConnectedStr:return ICETransportStateConnectedcase iceTransportStateCompletedStr:return ICETransportStateCompletedcase iceTransportStateFailedStr:return ICETransportStateFailedcase iceTransportStateDisconnectedStr:return ICETransportStateDisconnectedcase iceTransportStateClosedStr:return ICETransportStateCloseddefault:return ICETransportStateUnknown}}func ( ICETransportState) () string {switch {case ICETransportStateNew:return iceTransportStateNewStrcase ICETransportStateChecking:return iceTransportStateCheckingStrcase ICETransportStateConnected:return iceTransportStateConnectedStrcase ICETransportStateCompleted:return iceTransportStateCompletedStrcase ICETransportStateFailed:return iceTransportStateFailedStrcase ICETransportStateDisconnected:return iceTransportStateDisconnectedStrcase ICETransportStateClosed:return iceTransportStateClosedStrdefault:return ErrUnknownType.Error()}}func newICETransportStateFromICE( ice.ConnectionState) ICETransportState {switch {case ice.ConnectionStateNew:return ICETransportStateNewcase ice.ConnectionStateChecking:return ICETransportStateCheckingcase ice.ConnectionStateConnected:return ICETransportStateConnectedcase ice.ConnectionStateCompleted:return ICETransportStateCompletedcase ice.ConnectionStateFailed:return ICETransportStateFailedcase ice.ConnectionStateDisconnected:return ICETransportStateDisconnectedcase ice.ConnectionStateClosed:return ICETransportStateCloseddefault:return ICETransportStateUnknown}}func ( ICETransportState) () ice.ConnectionState {switch {case ICETransportStateNew:return ice.ConnectionStateNewcase ICETransportStateChecking:return ice.ConnectionStateCheckingcase ICETransportStateConnected:return ice.ConnectionStateConnectedcase ICETransportStateCompleted:return ice.ConnectionStateCompletedcase ICETransportStateFailed:return ice.ConnectionStateFailedcase ICETransportStateDisconnected:return ice.ConnectionStateDisconnectedcase ICETransportStateClosed:return ice.ConnectionStateCloseddefault:return ice.ConnectionStateUnknown}}// MarshalText implements encoding.TextMarshaler.func ( ICETransportState) () ([]byte, error) {return []byte(.String()), nil}// UnmarshalText implements encoding.TextUnmarshaler.func ( *ICETransportState) ( []byte) error {* = newICETransportState(string())return nil}
![]() |
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. |