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
|
||||
echo "accepted!"
|
||||
await sock.send("ping")
|
||||
let msg = await sock.recv(1000)
|
||||
let msg = await sock.recv(4)
|
||||
echo "received message: ", msg
|
||||
|
||||
else:
|
||||
|
@ -238,7 +238,7 @@ proc runApp(serverHostname: string, serverPort: Port, peerId: string,
|
|||
asyncCheck handleServerMessages(serverConn)
|
||||
let sock = await punchHole(punchdConn, serverConn, peerId, otherPeerId)
|
||||
echo "connected!"
|
||||
let msg = await sock.recv(1000)
|
||||
let msg = await sock.recv(4)
|
||||
echo "received message: ", msg
|
||||
await sock.send("pong")
|
||||
|
||||
|
|
Loading…
Reference in New Issue