capping at 2 second maximum

This commit is contained in:
Joseph Lawson
2014-04-22 16:05:00 -04:00
parent 3eed7c2546
commit e97827d600
+2 -2
View File
@@ -6,14 +6,14 @@ import (
"time"
)
const MSG_EXPIRE = 20000 * time.Millisecond
const MSG_EXPIRE = 2000 * time.Millisecond
// TCPMessage ensure that all TCP packets for given request is received, and processed in right sequence
// Its needed because all TCP message can be fragmented or re-transmitted
//
// Each TCP Packet have 2 ids: acknowledgment - message_id, and sequence - packet_id
// Message can be compiled from unique packets with same message_id which sorted by sequence
// Message is received if we didn't receive any packets for 20000ms
// Message is received if we didn't receive any packets for 2000ms
type TCPMessage struct {
ID string // Message ID
packets []*TCPPacket