Created
August 8, 2022 10:44
-
-
Save SirLich/b7d7c5775dd8adb7f843637b715aca79 to your computer and use it in GitHub Desktop.
Code Review for Reddit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def recvMessage(): | |
global MAXBYTES | |
global client | |
global connectedServer | |
while True: | |
try: | |
msg = client.recv(MAXBYTES) | |
msg = pickle.loads(msg) | |
print(msg) | |
typ = getMessageType(msg) | |
if typ == "CONSOLE": | |
handleMessageFrmConsole(msg) | |
elif typ == "MESSAGE": | |
handleMessage(msg[1]) | |
except ConnectionResetError as e: | |
print(e) | |
connectedServer = False | |
eel.closeWindow() | |
sys.exit(-1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment