How can I remove the additional text that is wirtten twice in my server-client chat?

时间:2019-06-01 14:14:27

标签: python multithreading chat

Every time when I write something else, it shows me the first sentence I already wrote in addition to the new content.

def accept_client():
    while True:    
        cli_sock, cli_add = ser_sock.accept()
        uname = cli_sock.recv(1024)
        name,message=uname.split(">")
        CONNECTION_LIST.append((uname, cli_sock))
        print('%s is now connected' %name)
        thread_client = threading.Thread(target = broadcast_usr, args=[uname, cli_sock])
        thread_client.start()

#this is my code from the server of the chat...

0 个答案:

没有答案