diff --git a/eth/utp/utp.nim b/eth/utp/utp.nim index 02004ec..6fa8e58 100644 --- a/eth/utp/utp.nim +++ b/eth/utp/utp.nim @@ -8,6 +8,7 @@ import chronos, stew/byteutils, + ./utp_router, ./utp_socket, ./utp_protocol @@ -18,9 +19,9 @@ import # 3. make # 4. ./ucat -ddddd -l -p 9078 - it will run utp server on port 9078 when isMainModule: - proc echoIncomingSocketCallBack(): AcceptConnectionCallback = + proc echoIncomingSocketCallBack(): AcceptConnectionCallback[TransportAddress] = return ( - proc (server: UtpProtocol, client: UtpSocket): Future[void] {.gcsafe, raises: [Defect].} = + proc (server: UtpRouter[TransportAddress], client: UtpSocket[TransportAddress]): Future[void] {.gcsafe, raises: [Defect].} = echo "received incoming connection" let fakeFuture = newFuture[void]() fakeFuture.complete() @@ -40,6 +41,10 @@ when isMainModule: discard waitFor soc.write(bytes) + waitFor(sleepAsync(milliseconds(1000))) + + discard waitFor soc.write(bytes) + runForever() waitFor utpProt.closeWait()