fix both ws rpc server and client due to websock breaking changes

- change recv() to recvMsg()
This commit is contained in:
jangko 2021-08-05 14:54:36 +07:00
parent a1715e33ac
commit b2417fc071
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ proc processData(client: RpcWebSocketClient) {.async.} =
let ws = client.transport let ws = client.transport
try: try:
while ws.readystate != ReadyState.Closed: while ws.readystate != ReadyState.Closed:
var value = await ws.recv() var value = await ws.recvMsg()
if value.len == 0: if value.len == 0:
# transmission ends # transmission ends

View File

@ -26,7 +26,7 @@ proc handleRequest(rpc: RpcWebSocketServer, request: HttpRequest) {.async.} =
trace "Websocket handshake completed" trace "Websocket handshake completed"
while ws.readyState != ReadyState.Closed: while ws.readyState != ReadyState.Closed:
let recvData = await ws.recv() let recvData = await ws.recvMsg()
trace "Client message: ", size = recvData.len, binary = ws.binary trace "Client message: ", size = recvData.len, binary = ws.binary
if ws.readyState == ReadyState.Closed: if ws.readyState == ReadyState.Closed: