mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-16 18:37:51 +01:00
UDT: Multiplexer pass down external termination signal. This makes sure any socket reader will return with EOF and does not hang.
Change transferSequenceTimeout to 1 minute which is more appropriate.
This commit is contained in:
@@ -18,7 +18,7 @@ import (
|
||||
)
|
||||
|
||||
// transferSequenceTimeout is the timeout for a follow-up message to appear, otherwise the transfer will be terminated.
|
||||
var transferSequenceTimeout = time.Minute * 10
|
||||
var transferSequenceTimeout = time.Minute * 1
|
||||
|
||||
// maxFlowWinSize is the maximum number of unacknowledged packets to permit. A higher number means using more memory, but reduces potential overhead since it does not stop so quickly for missing packets.
|
||||
// Each unacknowledged packet may store protocol.TransferMaxEmbedSize (currently 1121 bytes) payload data in memory. A too high number may impact the speed of real-time streaming in case of lost packets.
|
||||
|
||||
@@ -49,6 +49,7 @@ func (m *multiplexer) goRead() {
|
||||
select {
|
||||
case buf = <-m.incomingData:
|
||||
case <-m.terminationSignal:
|
||||
m.socket.Close() // Pass the external termination signal down to the socket. This makes sure any pending reader on the socket (especially if blocking) returns with EOF.
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user