1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-31 08:18:50 -04:00
v2fly/external/github.com/lucas-clemente/quic-go/internal/ackhandler/send_mode.go

37 lines
749 B
Go
Raw Normal View History

2018-11-20 17:51:25 -05:00
package ackhandler
import "fmt"
// The SendMode says what kind of packets can be sent.
type SendMode uint8
const (
// SendNone means that no packets should be sent
SendNone SendMode = iota
// SendAck means an ACK-only packet should be sent
SendAck
// SendRetransmission means that retransmissions should be sent
SendRetransmission
2019-01-14 14:52:10 -05:00
// SendPTO means that a probe packet should be sent
SendPTO
2018-11-20 17:51:25 -05:00
// SendAny means that any packet should be sent
SendAny
)
func (s SendMode) String() string {
switch s {
case SendNone:
return "none"
case SendAck:
return "ack"
case SendRetransmission:
return "retransmission"
2019-01-14 14:52:10 -05:00
case SendPTO:
return "pto"
2018-11-20 17:51:25 -05:00
case SendAny:
return "any"
default:
return fmt.Sprintf("invalid send mode: %d", s)
}
}