add debug output

This commit is contained in:
Christian Ulrich 2020-11-17 22:50:00 +01:00
parent 87f1ed89fb
commit c8a9a32a3f
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import asyncdispatch, asyncnet, net, port_prediction
import asyncdispatch, asyncnet, net, port_prediction, strformat
from nativesockets import SockAddr, SockAddr_storage, SockLen
from sequtils import any
@ -41,6 +41,7 @@ proc punch(puncher: Puncher, peerIp: IpAddress, peerPort: Port,
raise newException(PunchHoleError,
"hole punching for given parameters already active")
puncher.attempts.add(attempt)
echo &"sending msg {msg} to {peerIp}, predicted ports: {attempt.dstPorts}"
var peerAddr: Sockaddr_storage
var peerSockLen: SockLen
try: