craps
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m25s

This commit is contained in:
matst80
2024-11-13 20:16:40 +01:00
parent dafefa377f
commit 9f7c8227c2
6 changed files with 299 additions and 22 deletions

View File

@@ -2,7 +2,6 @@ package main
import (
"encoding/binary"
"fmt"
"log"
"net"
"sync"
@@ -139,11 +138,7 @@ func (m *TCPClient) Call(messageType PoolMessage, responseType PoolMessage, data
return nil, m.PersistentConnection.HandleConnectionError(err)
}
select {
case ret := <-packetChan:
return &ret, nil
case <-time.After(time.Second):
log.Printf("Timeout waiting for cart response to message type %d\n", responseType)
return nil, m.PersistentConnection.HandleConnectionError(fmt.Errorf("timeout"))
}
ret := <-packetChan
return &ret, nil
}