feat(wip): udp rework server side

This commit is contained in:
Toby
2023-07-23 11:42:52 -07:00
parent 6245f83262
commit a2fbcc6507
17 changed files with 554 additions and 513 deletions

View File

@@ -0,0 +1,24 @@
package utils
import (
"sync/atomic"
"time"
)
type AtomicTime struct {
v atomic.Value
}
func NewAtomicTime(t time.Time) *AtomicTime {
a := &AtomicTime{}
a.Set(t)
return a
}
func (t *AtomicTime) Set(new time.Time) {
t.v.Store(new)
}
func (t *AtomicTime) Get() time.Time {
return t.v.Load().(time.Time)
}