File tree 4 files changed +12
-154
lines changed
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
2
2
3
3
go 1.21
4
4
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 =
5
3
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg =
6
4
github.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
2
2
3
3
import (
4
4
"fmt"
5
- "github.com/RoboCup-SSL/ssl-status-board /pkg/sslnet"
5
+ "github.com/RoboCup-SSL/ssl-go-tools /pkg/sslnet"
6
6
"github.com/gorilla/websocket"
7
7
"log"
8
+ "net"
8
9
"net/http"
9
10
"sync"
10
11
"time"
@@ -23,21 +24,22 @@ type Board struct {
23
24
func NewBoard (cfg RefereeConfig ) (b * Board ) {
24
25
b = new (Board )
25
26
b .cfg = cfg
26
- b .MulticastServer = sslnet .NewMulticastServer (b .handlingMessage )
27
+ b .MulticastServer = sslnet .NewMulticastServer (b .cfg .MulticastAddress )
28
+ b .MulticastServer .Consumer = b .handlingMessage
27
29
return
28
30
}
29
31
30
32
// Start listening for messages
31
33
func (b * Board ) Start () {
32
- b .MulticastServer .Start (b . cfg . MulticastAddress )
34
+ b .MulticastServer .Start ()
33
35
}
34
36
35
37
// Stop listening for messages
36
38
func (b * Board ) Stop () {
37
39
b .MulticastServer .Stop ()
38
40
}
39
41
40
- func (b * Board ) handlingMessage (data []byte ) {
42
+ func (b * Board ) handlingMessage (data []byte , _ * net. UDPAddr ) {
41
43
b .mutex .Lock ()
42
44
defer b .mutex .Unlock ()
43
45
b .refereeData = data
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments