mirror of
https://github.com/status-im/nim-eth.git
synced 2025-02-13 06:26:37 +00:00
Fix test app
This commit is contained in:
parent
ca09885b76
commit
b35cf5cb48
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user