2022-07-21 18:50:10 +02:00
|
|
|
package wire
|
|
|
|
|
|
|
|
import (
|
2023-02-02 12:42:11 +01:00
|
|
|
"github.com/quic-go/quic-go/internal/protocol"
|
2022-07-21 18:50:10 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// A PingFrame is a PING frame
|
|
|
|
type PingFrame struct{}
|
|
|
|
|
2024-03-26 19:56:06 +01:00
|
|
|
func (f *PingFrame) Append(b []byte, _ protocol.Version) ([]byte, error) {
|
2023-05-01 16:05:02 +02:00
|
|
|
return append(b, pingFrameType), nil
|
2022-07-21 18:50:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Length of a written frame
|
2024-03-26 19:56:06 +01:00
|
|
|
func (f *PingFrame) Length(_ protocol.Version) protocol.ByteCount {
|
2022-07-21 18:50:10 +02:00
|
|
|
return 1
|
|
|
|
}
|