Skip to content

Commit bd0471d

Browse files
Yuzz1eg3force
authored andcommitted
⚠️ change multicast ttl
1 parent 1275363 commit bd0471d

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ require (
1111
gopkg.in/yaml.v3 v3.0.1
1212
)
1313

14-
require golang.org/x/net v0.23.0 // indirect
14+
require (
15+
golang.org/x/net v0.23.0 // indirect
16+
golang.org/x/sys v0.18.0 // indirect
17+
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
1010
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
1111
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
1212
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
13+
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
14+
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
1315
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
1416
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
1517
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=

internal/app/publish/publisher.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package publish
22

33
import (
4-
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/state"
5-
"google.golang.org/protobuf/proto"
64
"log"
75
"net"
6+
7+
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/state"
8+
"golang.org/x/net/ipv4"
9+
"google.golang.org/protobuf/proto"
810
)
911

1012
const maxDatagramSize = 8192
@@ -51,6 +53,11 @@ func (p *Publisher) connect() bool {
5153
log.Printf("Could not connect to '%v': %v", addr, err)
5254
continue
5355
}
56+
conn2 := ipv4.NewPacketConn(conn)
57+
err = conn2.SetMulticastTTL(32)
58+
if err != nil {
59+
log.Printf("Could not set TTL to 32: %v", err)
60+
}
5461

5562
if err := conn.SetWriteBuffer(maxDatagramSize); err != nil {
5663
log.Printf("Could not set write buffer to %v.", maxDatagramSize)

0 commit comments

Comments
 (0)