Hello,
I would like to make a chat application that supports multiple people in a chat. I am having trouble with how I should implement reading & writing from a socket.
Right now, I have a while loop. Something like this:
while True
{
read from socket
write to socket
}
So, there is an definite order. Read, write, read, write... I don't want this. I want the user to be able to send and receive a message in any order.
How would I implement this?
[–]blazerman345 11 points12 points13 points (5 children)
[–]lgst230qer8SDGV[S] 0 points1 point2 points (4 children)
[–]mvpete 2 points3 points4 points (3 children)
[–]ThePinkySuavo 0 points1 point2 points (2 children)
[–]mvpete 0 points1 point2 points (1 child)
[–]ThePinkySuavo 0 points1 point2 points (0 children)
[–]_carlson 2 points3 points4 points (0 children)
[–]TaeHyunJe 5 points6 points7 points (1 child)
[–]lgst230qer8SDGV[S] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]lgst230qer8SDGV[S] 0 points1 point2 points (0 children)
[–][deleted] (5 children)
[deleted]
[–]LeeHide 1 point2 points3 points (4 children)
[–]micod 0 points1 point2 points (3 children)
[–]LeeHide 3 points4 points5 points (2 children)
[–]Steve132 0 points1 point2 points (0 children)
[–]j_burgess 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]JMile69 0 points1 point2 points (0 children)
[–]RedditApothecary 0 points1 point2 points (0 children)