Source File
tcptype.go
Belonging Package
github.com/pion/ice/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage iceimport// TCPType is the type of ICE TCP candidate as described in// https://tools.ietf.org/html/rfc6544#section-4.5type TCPType intconst (// TCPTypeUnspecified is the default value. For example UDP candidates do not// need this field.TCPTypeUnspecified TCPType = iota// TCPTypeActive is active TCP candidate, which initiates TCP connections.TCPTypeActive// TCPTypePassive is passive TCP candidate, only accepts TCP connections.TCPTypePassive// TCPTypeSimultaneousOpen is like active and passive at the same time.TCPTypeSimultaneousOpen)// NewTCPType creates a new TCPType from string.func ( string) TCPType {switch strings.ToLower() {case "active":return TCPTypeActivecase "passive":return TCPTypePassivecase "so":return TCPTypeSimultaneousOpendefault:return TCPTypeUnspecified}}func ( TCPType) () string {switch {case TCPTypeUnspecified:return ""case TCPTypeActive:return "active"case TCPTypePassive:return "passive"case TCPTypeSimultaneousOpen:return "so"default: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. |