From 5cee80942f9c15fa698ab5e493779f39aea8a161 Mon Sep 17 00:00:00 2001 From: Jiri Kalvoda <jirikalvoda@kam.mff.cuni.cz> Date: Fri, 19 Jul 2024 12:21:45 +0200 Subject: [PATCH] client_config.py.example: Fix connection duplication --- prog/client_config.py.example | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/prog/client_config.py.example b/prog/client_config.py.example index ea5276d..f1400ac 100644 --- a/prog/client_config.py.example +++ b/prog/client_config.py.example @@ -7,9 +7,9 @@ c = None async def get_communication(): # This function must return communication.MainServer connected to your server # Multiple calls to this function should return the same connection - global c - cmd='ssh jr@externalArch.jk.dyn.blatto.eu /mnt/jr/jr/prog/run_py server.py' - socket = await communication.SSHRunSocket().connect(cmd) - c = communication.MainServer(socket) + if c: + cmd='ssh jr@externalArch.jk.dyn.blatto.eu /mnt/jr/jr/prog/run_py server.py' + socket = await communication.SSHRunSocket().connect(cmd) + c = communication.MainServer(socket) return c -- GitLab