1 Star 0 Fork 0

liuzh0324/webrtc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sctptransportstate.go 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
Max Hawkins 提交于 2019-02-15 13:47 . Remove rtc prefix from filenames
package webrtc
// SCTPTransportState indicates the state of the SCTP transport.
type SCTPTransportState int
const (
// SCTPTransportStateConnecting indicates the SCTPTransport is in the
// process of negotiating an association. This is the initial state of the
// SCTPTransportState when an SCTPTransport is created.
SCTPTransportStateConnecting SCTPTransportState = iota + 1
// SCTPTransportStateConnected indicates the negotiation of an
// association is completed.
SCTPTransportStateConnected
// SCTPTransportStateClosed indicates a SHUTDOWN or ABORT chunk is
// received or when the SCTP association has been closed intentionally,
// such as by closing the peer connection or applying a remote description
// that rejects data or changes the SCTP port.
SCTPTransportStateClosed
)
// This is done this way because of a linter.
const (
sctpTransportStateConnectingStr = "connecting"
sctpTransportStateConnectedStr = "connected"
sctpTransportStateClosedStr = "closed"
)
func newSCTPTransportState(raw string) SCTPTransportState {
switch raw {
case sctpTransportStateConnectingStr:
return SCTPTransportStateConnecting
case sctpTransportStateConnectedStr:
return SCTPTransportStateConnected
case sctpTransportStateClosedStr:
return SCTPTransportStateClosed
default:
return SCTPTransportState(Unknown)
}
}
func (s SCTPTransportState) String() string {
switch s {
case SCTPTransportStateConnecting:
return sctpTransportStateConnectingStr
case SCTPTransportStateConnected:
return sctpTransportStateConnectedStr
case SCTPTransportStateClosed:
return sctpTransportStateClosedStr
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