craps
This commit is contained in:
@@ -2,10 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"log"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CartClient struct {
|
||||
@@ -73,13 +71,9 @@ func (m *CartTCPClient) call(messageType CartMessage, id CartId, responseType Ca
|
||||
if err != nil {
|
||||
return nil, m.PersistentConnection.HandleConnectionError(err)
|
||||
}
|
||||
select {
|
||||
case ret := <-packetChan:
|
||||
return &ret, nil
|
||||
case <-time.After(time.Millisecond * 300):
|
||||
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
|
||||
}
|
||||
|
||||
func isRetirableError(err error) bool {
|
||||
|
||||
Reference in New Issue
Block a user