P
P
Popchik2017-10-18 11:11:00
Python
Popchik, 2017-10-18 11:11:00

What is the best way to organize P2P chatting in Python?

I'm trying to make chat on sockets in python.
There was such a problem, after sending a message, the client waits for a response, that is, it is impossible to send two messages in a row. So how do I make the Clint always wait for a message and print it when it's available, but still be able to send his own message? To do two sockets and to go to flows? Or is there a better solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-10-18
@Popchik

It is necessary to divide the program into threads. One of the threads will constantly wait for messages, the other will process the GUI and another one will send messages (we don’t want the program to hang while sending).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question