run_ping_client
is a thread, so time.sleep will only hold up the code running within that thread. Also yes, you can use json to easily send lists over the socket. json.dumps
will take in a list and return a string which you can encode and send across the socket. json.loads
will take in a string and turn it back into a list.