Properly use already specified MaxReadWriteTime as timeout

This commit is contained in:
Giovanni Petrantoni 2020-02-11 14:43:01 +09:00
parent 314cb6e6bf
commit 8f5dd75e7f
1 changed files with 1 additions and 3 deletions

View File

@ -23,8 +23,6 @@ import ../muxer,
logScope:
topic = "Mplex"
const HandleTimeout = 30.seconds
type
Mplex* = ref object of Muxer
remote*: Table[uint, LPChannel]
@ -70,7 +68,7 @@ method handle*(m: Mplex) {.async, gcsafe.} =
while not m.connection.closed:
trace "waiting for data"
let
res = await one(m.connection.readMsg(), messageTimeout(HandleTimeout))
res = await one(m.connection.readMsg(), messageTimeout(MaxReadWriteTime))
msg = res.read()
if msg.isNone:
trace "connection EOF"