From f2b4a45a899c6afbe9604e13906862c5ab0d289b Mon Sep 17 00:00:00 2001 From: mykola2312 <49044616+mykola2312@users.noreply.github.com> Date: Mon, 30 Dec 2024 09:23:27 +0200 Subject: [PATCH] fix enums, working on channels --- net/lux_channel.go | 20 ++++++++++++++++++++ proto/lux_type.go | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 net/lux_channel.go diff --git a/net/lux_channel.go b/net/lux_channel.go new file mode 100644 index 0000000..f9efc55 --- /dev/null +++ b/net/lux_channel.go @@ -0,0 +1,20 @@ +package net + +import "net" + +type LuxChannelType uint + +const ( + LuxChannelInterior = 0 + LuxChannelExterior = 1 +) + +type LuxChannel struct { + Type LuxChannelType + Address *net.UDPAddr + conn *net.UDPConn +} + +func (ch *LuxChannel) Close() { + ch.conn.Close() +} diff --git a/proto/lux_type.go b/proto/lux_type.go index 9707544..b5a72a7 100644 --- a/proto/lux_type.go +++ b/proto/lux_type.go @@ -4,7 +4,7 @@ type LuxType uint const ( LuxTypeHost = 0 - LuxTypeNode + LuxTypeNode = 1 ) const LUX_PROTO_TYPE_SIZE = 2