From 6d1be18d58a2e6874cddc59e0f01a14e153d1938 Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 28 Jun 2019 17:10:49 -0400 Subject: add MPSCQueue and more --- msg.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'msg.go') diff --git a/msg.go b/msg.go index 0e3434e..d1ee1bb 100644 --- a/msg.go +++ b/msg.go @@ -43,3 +43,13 @@ func (self Msg) GetPayloadByMove() DataStream { func (self Msg) GetOpcode() Opcode { return Opcode(C.msg_get_opcode(self.inner)) } + +// Get the magic number. +func (self Msg) GetMagic() uint32 { + return uint32(C.msg_get_magic(self.inner)) +} + +// Set the magic number (the default value is 0x0). +func (self Msg) SetMagic(magic uint32) { + C.msg_set_magic(self.inner, C.uint32_t(magic)) +} -- cgit v1.2.3