aboutsummaryrefslogtreecommitdiff
path: root/jsonrpc/examples/client.py
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-04-11 10:19:20 +0200
committerhozan23 <hozan23@karyontech.net>2024-05-19 13:51:30 +0200
commit0992071a7f1a36424bcfaf1fbc84541ea041df1a (patch)
tree961d73218af672797d49f899289bef295bc56493 /jsonrpc/examples/client.py
parenta69917ecd8272a4946cfd12c75bf8f8c075b0e50 (diff)
add support for tokio & improve net crate api
Diffstat (limited to 'jsonrpc/examples/client.py')
-rw-r--r--jsonrpc/examples/client.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/jsonrpc/examples/client.py b/jsonrpc/examples/client.py
index 2066e82..745d5db 100644
--- a/jsonrpc/examples/client.py
+++ b/jsonrpc/examples/client.py
@@ -3,7 +3,7 @@ import random
import json
HOST = "127.0.0.1"
-PORT = 60000
+PORT = 6000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
@@ -15,7 +15,7 @@ req = {
"params": {"x": 4, "y": 3},
}
print("Send: ", req)
-s.sendall((json.dumps(req) + '\n').encode())
+s.sendall((json.dumps(req)).encode())
res = s.recv(1024)
res = json.loads(res)
print("Received: ", res)
@@ -27,7 +27,7 @@ req = {
"params": {"x": 4, "y": 3},
}
print("Send: ", req)
-s.sendall((json.dumps(req) + '\n').encode())
+s.sendall((json.dumps(req)).encode())
res = s.recv(1024)
res = json.loads(res)
print("Received: ", res)
@@ -39,7 +39,7 @@ req = {
"params": None,
}
print("Send: ", req)
-s.sendall((json.dumps(req) + '\n').encode())
+s.sendall((json.dumps(req)).encode())
res = s.recv(1024)
res = json.loads(res)
print("Received: ", res)
@@ -51,7 +51,7 @@ req = {
"params": None,
}
print("Send: ", req)
-s.sendall((json.dumps(req) + '\n').encode())
+s.sendall((json.dumps(req)).encode())
res = s.recv(1024)
res = json.loads(res)
print("Received: ", res)