I made an online connect 4 game that uses the following logic:
Player1 sends their move to the server
Server sends the move to Player2
Player2 receives the move, makes their own move and sends it to the server
Server sends the move to Player1
Player1 receives the move, makes their own move and sends it to the server
(until someone wins or it's a draw)
It works but there is a problem: when player1 takes a while to choose their move and player2 is waiting to receive, player2's pygame window becomes unresponsive since it is stuck in a .recv() call. How can I fix this?