1 Star 0 Fork 0

liuzh0324/webrtc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dtlstransportstate.go 2.19 KB
一键复制 编辑 原始数据 按行查看 历史
Vicken Simonian 提交于 2019-10-17 22:28 . Various spell fixes
package webrtc
// DTLSTransportState indicates the DTLS transport establishment state.
type DTLSTransportState int
const (
// DTLSTransportStateNew indicates that DTLS has not started negotiating
// yet.
DTLSTransportStateNew DTLSTransportState = iota + 1
// DTLSTransportStateConnecting indicates that DTLS is in the process of
// negotiating a secure connection and verifying the remote fingerprint.
DTLSTransportStateConnecting
// DTLSTransportStateConnected indicates that DTLS has completed
// negotiation of a secure connection and verified the remote fingerprint.
DTLSTransportStateConnected
// DTLSTransportStateClosed indicates that the transport has been closed
// intentionally as the result of receipt of a close_notify alert, or
// calling close().
DTLSTransportStateClosed
// DTLSTransportStateFailed indicates that the transport has failed as
// the result of an error (such as receipt of an error alert or failure to
// validate the remote fingerprint).
DTLSTransportStateFailed
)
// This is done this way because of a linter.
const (
dtlsTransportStateNewStr = "new"
dtlsTransportStateConnectingStr = "connecting"
dtlsTransportStateConnectedStr = "connected"
dtlsTransportStateClosedStr = "closed"
dtlsTransportStateFailedStr = "failed"
)
func newDTLSTransportState(raw string) DTLSTransportState {
switch raw {
case dtlsTransportStateNewStr:
return DTLSTransportStateNew
case dtlsTransportStateConnectingStr:
return DTLSTransportStateConnecting
case dtlsTransportStateConnectedStr:
return DTLSTransportStateConnected
case dtlsTransportStateClosedStr:
return DTLSTransportStateClosed
case dtlsTransportStateFailedStr:
return DTLSTransportStateFailed
default:
return DTLSTransportState(Unknown)
}
}
func (t DTLSTransportState) String() string {
switch t {
case DTLSTransportStateNew:
return dtlsTransportStateNewStr
case DTLSTransportStateConnecting:
return dtlsTransportStateConnectingStr
case DTLSTransportStateConnected:
return dtlsTransportStateConnectedStr
case DTLSTransportStateClosed:
return dtlsTransportStateClosedStr
case DTLSTransportStateFailed:
return dtlsTransportStateFailedStr
default:
return ErrUnknownType.Error()
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/natoverload/webrtc.git
git@gitee.com:natoverload/webrtc.git
natoverload
webrtc
webrtc
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385