This commit is contained in:
2024-12-19 21:48:46 -06:00
parent a6cfd3db86
commit ea184a936d
22 changed files with 29 additions and 39 deletions
-2
View File
@@ -25,7 +25,6 @@ func getNTrackers(n int) []psn.Tracker {
}
func main() {
testSizes := []int{1, 10, 100, 1000}
encoder := psn.Encoder{
SystemName: "test encoder",
@@ -39,7 +38,6 @@ func main() {
benchmark(trackerCount, iterations, encoder, *decoder)
}
}
}
type BenchmarkResults struct {
+8 -4
View File
@@ -10,13 +10,17 @@ import (
func main() {
decoder := psn.NewDecoder()
infoPacketBytes := []byte{0x56, 0x67, 0x34, 0x80, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x01,
infoPacketBytes := []byte{
0x56, 0x67, 0x34, 0x80, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x01,
0x01, 0x01, 0x00, 0x0b, 0x00, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x02, 0x00, 0x11,
0x80, 0x01, 0x00, 0x0d, 0x80, 0x00, 0x00, 0x09, 0x00, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x20, 0x31}
0x80, 0x01, 0x00, 0x0d, 0x80, 0x00, 0x00, 0x09, 0x00, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x20, 0x31,
}
dataPacketBytes := []byte{0x55, 0x67, 0x28, 0x80, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x01,
dataPacketBytes := []byte{
0x55, 0x67, 0x28, 0x80, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x01,
0x01, 0x01, 0x00, 0x14, 0x80, 0x01, 0x00, 0x10, 0x80, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00,
0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f}
0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f,
}
decoder.Decode(infoPacketBytes)
decoder.Decode(dataPacketBytes)
-2
View File
@@ -7,7 +7,6 @@ import (
)
func main() {
encoder := psn.Encoder{
SystemName: "Server Name",
VersionHigh: 2,
@@ -41,5 +40,4 @@ func main() {
fmt.Printf("%v\n", infoPacket)
}
}
-2
View File
@@ -16,7 +16,6 @@ func main() {
}
client, err := net.ListenMulticastUDP("udp", nil, addr)
if err != nil {
fmt.Printf("Error %v\n", err)
return
@@ -31,7 +30,6 @@ func main() {
buffer := make([]byte, 2048)
length, _, err := client.ReadFromUDP(buffer)
if err != nil {
fmt.Printf("Error %v", err)
}
-2
View File
@@ -11,7 +11,6 @@ import (
func main() {
client, err := net.Dial("udp", "236.10.10.10:56565")
if err != nil {
fmt.Printf("Error %v\n", err)
return
@@ -81,5 +80,4 @@ func main() {
}
}
}