Skip to content

Instantly share code, notes, and snippets.

@SirLich
Created August 8, 2022 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SirLich/b7d7c5775dd8adb7f843637b715aca79 to your computer and use it in GitHub Desktop.
Save SirLich/b7d7c5775dd8adb7f843637b715aca79 to your computer and use it in GitHub Desktop.
Code Review for Reddit
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