File tree Expand file tree Collapse file tree 4 files changed +12
-154
lines changed
Expand file tree Collapse file tree 4 files changed +12
-154
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ module github.com/RoboCup-SSL/ssl-status-board
22
33go 1.21
44
5- require github.com/gorilla/websocket v1.5.3
6-
7- require golang.org/x/net v0.34.0 // indirect
5+ require (
6+ github.com/RoboCup-SSL/ssl-go-tools v1.8.1
7+ github.com/gorilla/websocket v1.5.3
8+ )
Original file line number Diff line number Diff line change 1- github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc =
2- github.com/gorilla/websocket v1.5.0 /go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE =
3- github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY =
4- github.com/gorilla/websocket v1.5.1 /go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY =
1+ github.com/RoboCup-SSL/ssl-go-tools v1.8.1 h1:6EAIeJdgr2BO1lfQNrt1vNFFKiKScqjd1HrZsCZ07rg =
2+ github.com/RoboCup-SSL/ssl-go-tools v1.8.1 /go.mod h1:FuTw472klW5wAMg09gxQqPCzu6ygxOdMA8D22fDOUfM =
53github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg =
64github.com/gorilla/websocket v1.5.3 /go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE =
7- golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c =
8- golang.org/x/net v0.19.0 /go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U =
9- golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0 =
10- golang.org/x/net v0.34.0 /go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k =
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ package board
22
33import (
44 "fmt"
5- "github.com/RoboCup-SSL/ssl-status-board /pkg/sslnet"
5+ "github.com/RoboCup-SSL/ssl-go-tools /pkg/sslnet"
66 "github.com/gorilla/websocket"
77 "log"
8+ "net"
89 "net/http"
910 "sync"
1011 "time"
@@ -23,21 +24,22 @@ type Board struct {
2324func NewBoard (cfg RefereeConfig ) (b * Board ) {
2425 b = new (Board )
2526 b .cfg = cfg
26- b .MulticastServer = sslnet .NewMulticastServer (b .handlingMessage )
27+ b .MulticastServer = sslnet .NewMulticastServer (b .cfg .MulticastAddress )
28+ b .MulticastServer .Consumer = b .handlingMessage
2729 return
2830}
2931
3032// Start listening for messages
3133func (b * Board ) Start () {
32- b .MulticastServer .Start (b . cfg . MulticastAddress )
34+ b .MulticastServer .Start ()
3335}
3436
3537// Stop listening for messages
3638func (b * Board ) Stop () {
3739 b .MulticastServer .Stop ()
3840}
3941
40- func (b * Board ) handlingMessage (data []byte ) {
42+ func (b * Board ) handlingMessage (data []byte , _ * net. UDPAddr ) {
4143 b .mutex .Lock ()
4244 defer b .mutex .Unlock ()
4345 b .refereeData = data
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments