parent
206a4cee77
commit
e041c184d2
1 changed files with 3 additions and 1 deletions
|
|
@ -13,8 +13,8 @@ else:
|
||||||
# This reproduces a case where a socket remains stuck waiting for writes
|
# This reproduces a case where a socket remains stuck waiting for writes
|
||||||
# even when the socket is closed.
|
# even when the socket is closed.
|
||||||
const
|
const
|
||||||
port = Port(50726)
|
|
||||||
timeout = 8000
|
timeout = 8000
|
||||||
|
var port = Port(0)
|
||||||
|
|
||||||
var sent = 0
|
var sent = 0
|
||||||
|
|
||||||
|
|
@ -86,6 +86,8 @@ proc server() {.async.} =
|
||||||
s.setSockOpt(OptReuseAddr, true)
|
s.setSockOpt(OptReuseAddr, true)
|
||||||
s.bindAddr(port)
|
s.bindAddr(port)
|
||||||
s.listen()
|
s.listen()
|
||||||
|
let (addr2, port2) = s.getLocalAddr
|
||||||
|
port = port2
|
||||||
|
|
||||||
# We're now ready to accept connections, so start the client
|
# We're now ready to accept connections, so start the client
|
||||||
asyncCheck startClient()
|
asyncCheck startClient()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue