pass exact size to recv
This commit is contained in:
parent
239131eae5
commit
af9dedf75a
|
@ -228,7 +228,7 @@ proc runApp(serverHostname: string, serverPort: Port, peerId: string,
|
||||||
break
|
break
|
||||||
echo "accepted!"
|
echo "accepted!"
|
||||||
await sock.send("ping")
|
await sock.send("ping")
|
||||||
let msg = await sock.recv(1000)
|
let msg = await sock.recv(4)
|
||||||
echo "received message: ", msg
|
echo "received message: ", msg
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -238,7 +238,7 @@ proc runApp(serverHostname: string, serverPort: Port, peerId: string,
|
||||||
asyncCheck handleServerMessages(serverConn)
|
asyncCheck handleServerMessages(serverConn)
|
||||||
let sock = await punchHole(punchdConn, serverConn, peerId, otherPeerId)
|
let sock = await punchHole(punchdConn, serverConn, peerId, otherPeerId)
|
||||||
echo "connected!"
|
echo "connected!"
|
||||||
let msg = await sock.recv(1000)
|
let msg = await sock.recv(4)
|
||||||
echo "received message: ", msg
|
echo "received message: ", msg
|
||||||
await sock.send("pong")
|
await sock.send("pong")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue