working out synchronization issues
This commit is contained in:
parent
b1dd564c32
commit
acdaeb8f5d
|
@ -62,8 +62,7 @@ proc newChannel*(id: uint,
|
||||||
result.initBufferStream(writeHandler, size)
|
result.initBufferStream(writeHandler, size)
|
||||||
|
|
||||||
proc closeMessage(s: LPChannel) {.async.} =
|
proc closeMessage(s: LPChannel) {.async.} =
|
||||||
if not s.closed:
|
await s.conn.writeMsg(s.id, s.closeCode) # write header
|
||||||
await s.conn.writeMsg(s.id, s.closeCode) # write header
|
|
||||||
|
|
||||||
proc closedByRemote*(s: LPChannel) {.async.} =
|
proc closedByRemote*(s: LPChannel) {.async.} =
|
||||||
s.closedRemote = true
|
s.closedRemote = true
|
||||||
|
|
|
@ -223,7 +223,7 @@ suite "FloodSub":
|
||||||
await node.publish("foobar", cast[seq[byte]]("Hello!"))
|
await node.publish("foobar", cast[seq[byte]]("Hello!"))
|
||||||
await sleepAsync(100.millis)
|
await sleepAsync(100.millis)
|
||||||
|
|
||||||
await sleepAsync(1.minutes)
|
await sleepAsync(5000.millis)
|
||||||
await allFutures(nodes.mapIt(it.stop()))
|
await allFutures(nodes.mapIt(it.stop()))
|
||||||
await allFutures(awaitters)
|
await allFutures(awaitters)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue