From 7c010f9303390169b12b149a310e4201e7aa8dc2 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Sun, 26 Jul 2020 17:48:47 +0200 Subject: [PATCH] get-info -> get-peerinfo --- examples/app/app.nim | 6 +++--- examples/rendezvous_server/rendezvous_server.nim | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/app/app.nim b/examples/app/app.nim index 2022066..361a2fb 100644 --- a/examples/app/app.nim +++ b/examples/app/app.nim @@ -31,7 +31,7 @@ type args: string # Server messages - OkGetInfo* = object + OkGetPeerinfo* = object ip: string ports: array[3, uint16] OkGetEndpoint* = object @@ -147,8 +147,8 @@ proc handlePeerNotifications(serverConn: ServerConnection, proc punchHole(punchdConn: PunchdConnection, serverConn: ServerConnection, peerId: string, otherPeerId: string): Future[AsyncSocket] {.async.} = - let sResp = await serverConn.sendRequest("get-info", otherPeerId) - let peerInfo = parseMessage[OkGetInfo](sResp) + let sResp = await serverConn.sendRequest("get-peerinfo", otherPeerId) + let peerInfo = parseMessage[OkGetPeerinfo](sResp) proc progressCb(future: PunchdResponse, msgContent: string) {.async.} = try: let parsedResp = parseMessage[ProgressTcpSyniConnect](msgContent) diff --git a/examples/rendezvous_server/rendezvous_server.nim b/examples/rendezvous_server/rendezvous_server.nim index 29008ea..bda148a 100644 --- a/examples/rendezvous_server/rendezvous_server.nim +++ b/examples/rendezvous_server/rendezvous_server.nim @@ -17,7 +17,7 @@ type ip: IpAddress ports: array[3, Port] - GetInfo = object + GetPeerinfo = object peerId: string NotifyPeer = object @@ -94,9 +94,8 @@ proc processClient(client: AsyncSocket, asyncCheck client.sendEndpoint(id) removeClient(clients, peerId) break - # FIXME: get-peerinfo - of "get-info": - let req = parseMessage[GetInfo](args[2]) + of "get-peerinfo": + let req = parseMessage[GetPeerinfo](args[2]) echo "get-info: ", req let peer = clients[req.peerId] let peerPorts = peer.ports.join(",")