strange
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m49s

This commit is contained in:
matst80
2024-11-10 11:32:55 +01:00
parent 2b8f0f5704
commit 587eeaf18e
2 changed files with 5 additions and 2 deletions

View File

@@ -49,11 +49,14 @@ func SendPacket(conn io.Writer, messageType uint16, datafn func(w io.Writer) err
if err != nil { if err != nil {
return err return err
} }
binary.Write(conn, binary.LittleEndian, Packet{ err = binary.Write(conn, binary.LittleEndian, Packet{
Version: 1, Version: 1,
MessageType: messageType, MessageType: messageType,
DataLength: uint16(len(data)), DataLength: uint16(len(data)),
}) })
if err != nil {
return err
}
packetsSent.Inc() packetsSent.Inc()
_, err = conn.Write(data) _, err = conn.Write(data)
return err return err

View File

@@ -382,7 +382,7 @@ func (p *SyncedPool) OwnerChanged(id CartId, host string) error {
} }
func DoPing(host *RemoteHost) error { func DoPing(host *RemoteHost) error {
SendPacket(host.connection, Ping, func(w io.Writer) error { SendPacket(host, Ping, func(w io.Writer) error {
return nil return nil
}) })
_, err := host.Expect(Pong, time.Second) _, err := host.Expect(Pong, time.Second)