diff --git a/json_rpc.nimble b/json_rpc.nimble index 576bf77..daf3e32 100644 --- a/json_rpc.nimble +++ b/json_rpc.nimble @@ -28,4 +28,7 @@ proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "", lang exec "nim " & lang & " --out:./build/" & name & " " & params & " " & srcDir & name & ".nim" & " " & cmdParams task test, "run tests": - buildBinary "all", "tests/", "-r -f --hints:off --debuginfo --path:'.' --threads:on -d:chronicles_log_level=ERROR", getLang() + buildBinary "all", "tests/", + params = "-r -f --hints:off --debuginfo --path:'.' --threads:on -d:chronicles_log_level=ERROR", + cmdParams = "", + lang = getLang() diff --git a/json_rpc/rpcproxy.nim b/json_rpc/rpcproxy.nim index 08a600c..ec253ba 100644 --- a/json_rpc/rpcproxy.nim +++ b/json_rpc/rpcproxy.nim @@ -100,7 +100,7 @@ proc registerProxyMethod*(proxy: var RpcProxy, methodName: string) = proc stop*(proxy: RpcProxy) {.async.} = await proxy.getClient().close() - proxy.rpcHttpServer.stop() + await proxy.rpcHttpServer.stop() proc closeWait*(proxy: RpcProxy) {.async.} = await proxy.rpcHttpServer.closeWait() diff --git a/json_rpc/servers/httpserver.nim b/json_rpc/servers/httpserver.nim index df955d6..25c2a49 100644 --- a/json_rpc/servers/httpserver.nim +++ b/json_rpc/servers/httpserver.nim @@ -134,7 +134,7 @@ proc new*(T: type RpcHttpServer): T = T(router: RpcRouter.init(), httpServers: @[]) proc new*(T: type RpcHttpServer, router: RpcRouter): T = - T(router: router, servers: @[]) + T(router: router, httpServers: @[]) proc newRpcHttpServer*(): RpcHttpServer = RpcHttpServer.new() @@ -155,12 +155,12 @@ proc newRpcHttpServer*(addresses: openArray[string]): RpcHttpServer = proc newRpcHttpServer*(addresses: openArray[string], router: RpcRouter): RpcHttpServer = ## Create new server and assign it to addresses ``addresses``. result = newRpcHttpServer(router) - result.addStreamServers(addresses) + result.addHttpServers(addresses) proc newRpcHttpServer*(addresses: openArray[TransportAddress], router: RpcRouter): RpcHttpServer = ## Create new server and assign it to addresses ``addresses``. result = newRpcHttpServer(router) - result.addStreamServers(addresses) + result.addHttpServers(addresses) proc start*(server: RpcHttpServer) = ## Start the RPC server. diff --git a/tests/testproxy.nim b/tests/testproxy.nim index d0b1a11..04ec16f 100644 --- a/tests/testproxy.nim +++ b/tests/testproxy.nim @@ -40,7 +40,7 @@ suite "Proxy RPC through http": expect(CatchableError): discard waitFor client.call("missingMethod", %[%"abc"]) - srv.stop() + waitFor srv.stop() waitFor srv.closeWait() waitFor proxy.stop() waitFor proxy.closeWait()