summaryrefslogtreecommitdiff
path: root/vendor/github.com/pion/datachannel/message_channel_ack.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/pion/datachannel/message_channel_ack.go')
-rw-r--r--vendor/github.com/pion/datachannel/message_channel_ack.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/pion/datachannel/message_channel_ack.go b/vendor/github.com/pion/datachannel/message_channel_ack.go
new file mode 100644
index 0000000..fd20757
--- /dev/null
+++ b/vendor/github.com/pion/datachannel/message_channel_ack.go
@@ -0,0 +1,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
+}