Revert "Rename rpcstreamserver and newStreamServer to rpcsocketserver and newSocketServer"

This reverts commit 0dfb4be55c.
This commit is contained in:
coffeepots 2018-06-15 11:11:10 +01:00
parent 0dfb4be55c
commit 746232a928
5 changed files with 15 additions and 15 deletions

View File

@ -9,7 +9,7 @@ macro error(body: varargs[untyped]): untyped = newStmtList()
type RpcStreamServer* = RpcServer[StreamServer]
proc newRpcSocketServer*(addresses: openarray[TransportAddress]): RpcStreamServer =
proc newRpcStreamServer*(addresses: openarray[TransportAddress]): RpcStreamServer =
## Create new server and assign it to addresses ``addresses``.
result = RpcServer[StreamServer]()
result.procs = newTable[string, RpcProc]()
@ -28,7 +28,7 @@ proc newRpcSocketServer*(addresses: openarray[TransportAddress]): RpcStreamServe
# Server was not bound, critical error.
raise newException(RpcBindError, "Unable to create server!")
proc newRpcSocketServer*(addresses: openarray[string]): RpcServer[StreamServer] =
proc newRpcStreamServer*(addresses: openarray[string]): RpcServer[StreamServer] =
## Create new server and assign it to addresses ``addresses``.
var
tas4: seq[TransportAddress]
@ -57,9 +57,9 @@ proc newRpcSocketServer*(addresses: openarray[string]): RpcServer[StreamServer]
# Addresses could not be resolved, critical error.
raise newException(RpcAddressUnresolvableError, "Unable to get address!")
result = newRpcSocketServer(baddrs)
result = newRpcStreamServer(baddrs)
proc newRpcSocketServer*(address = "localhost", port: Port = Port(8545)): RpcServer[StreamServer] =
proc newRpcStreamServer*(address = "localhost", port: Port = Port(8545)): RpcServer[StreamServer] =
var
tas4: seq[TransportAddress]
tas6: seq[TransportAddress]
@ -74,7 +74,7 @@ proc newRpcSocketServer*(address = "localhost", port: Port = Port(8545)): RpcSer
try:
tas6 = resolveTAddress(address, port, IpAddressFamily.IPv6)
except:
error "Failed to create server for address", address = $item, errror = getCurrentException()
discard
if len(tas4) == 0 and len(tas6) == 0:
# Address was not resolved, critical error.
@ -91,7 +91,7 @@ proc newRpcSocketServer*(address = "localhost", port: Port = Port(8545)): RpcSer
udata = result)
result.servers.add(server)
except:
error "Failed to create server for address", address = $item, errror = getCurrentException()
error "Failed to create server for address", address = $item
for item in tas6:
try:
@ -100,7 +100,7 @@ proc newRpcSocketServer*(address = "localhost", port: Port = Port(8545)): RpcSer
udata = result)
result.servers.add(server)
except:
error "Failed to create server for address", address = $item, errror = getCurrentException()
error "Failed to create server", address = $item
if len(result.servers) == 0:
# Server was not bound, critical error.

View File

@ -3,10 +3,10 @@
allow unchecked and unformatted calls.
]#
import unittest, debugclient, ../rpcsocketservers
import unittest, debugclient, ../rpcstreamservers
import strformat, chronicles
var server = newRpcSocketServer("localhost", 8547.Port)
var server = newRpcStreamServer("localhost", 8547.Port)
var client = newRpcClient()
server.start()

View File

@ -1,5 +1,5 @@
import unittest, json, tables
import ../rpcclient, ../rpcsocketservers
import ../rpcclient, ../rpcstreamservers
import stint, ethtypes, ethprocs, stintjson, nimcrypto
from os import getCurrentDir, DirSep
@ -7,7 +7,7 @@ from strutils import rsplit
template sourceDir: string = currentSourcePath.rsplit(DirSep, 1)[0]
var
server = newRpcSocketServer("localhost", Port(8546))
server = newRpcStreamServer("localhost", Port(8546))
client = newRpcClient()
## Generate Ethereum server RPCs

View File

@ -1,5 +1,5 @@
import unittest, json, tables
import ../rpcsocketservers
import ../rpcstreamservers
type
# some nested types to check object parsing
@ -27,7 +27,7 @@ let
},
"c": %1.23}
var s = newRpcSocketServer(["localhost:8545"])
var s = newRpcStreamServer(["localhost:8545"])
# RPC definitions

View File

@ -1,7 +1,7 @@
import unittest, json
import ../rpcclient, ../rpcsocketservers
import ../rpcclient, ../rpcstreamservers
var srv = newRpcSocketServer(["localhost:8545"])
var srv = newRpcStreamServer(["localhost:8545"])
var client = newRpcClient()
# Create RPC on server