TCP/IP Client application for ZYNQ SOC

Hello,

I have found Echo server implementation step by step guide on ZYNQ SOC under the following link.

https://digilent.com/reference/programmable-logic/guides/zynq-servers?srsltid=AfmBOorTPK5iPrdgt0AEo6kO0JhQQ1i-KDNGHW7iNpWP0Ywe49DCoEME

I am wondering about creating TCP/IP Client application in Python that can be used to connect with two ZYNQ servers.

Here is my program. Kindly have a look and let me know if that make sense. Do I need to add/modify the following TCP/IP Client application.

print("This is TCP/IP Client")

import socket
s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

host = socket.gethostname()
port1 = 3200
port2 = 1255

s1.connect((host, port1))
s2.connect((host, port2))

token = True
while token:
    msg1 = input("Enter message send to TCP/IP Server - S1: ")
    s1.send(msg1.encode("utf-8"))
    message = s1.recv(1024).decode("utf-8")
    print("TCP/IP Server S1:", message)

    msg2 = input("Enter message send to TCP/IP Server - S2: ")
    s2.send(msg2.encode("utf-8"))
    message = s2.recv(1024).decode("utf-8")
    print("TCP/IP Server S2:", message)

    if msg1 == "quit":
        token = False
        s1.close()

    if msg2 == "quit":
        token = False
        s2.close()