File: message_channel_ack.go

package info (click to toggle)
golang-github-pion-datachannel 1.5.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, forky, sid, trixie
  • size: 232 kB
  • sloc: makefile: 2
file content (22 lines) | stat: -rw-r--r-- 522 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package datachannel

// channelAck is used to ACK a DataChannel open
type channelAck struct{}

const (
	channelOpenAckLength = 4
)

// Marshal returns raw bytes for the given message
func (c *channelAck) Marshal() ([]byte, error) {
	raw := make([]byte, channelOpenAckLength)
	raw[0] = uint8(dataChannelAck)

	return raw, nil
}

// Unmarshal populates the struct with the given raw data
func (c *channelAck) Unmarshal(raw []byte) error {
	// Message type already checked in Parse and there is no further data
	return nil
}