Hello I have written some client server code and write now I noticed I had a bug in how I am handling receiving a command
These are my commands
#Server Commands
CMD_MSG, CMD_MULTI, CMD_IP, CMD_AUDIO, CMD_AUDIO_MULTI, CMD_FILE = range(6)
I send a command like this
self.client(chr(CMD_AUDIO), data)
and receive like this
msg = conn.recv(2024)
if msg:
cmd, msg = ord(msg[0]),msg[1:]
if cmd == CMD_MSG:
#do something
The first command seems to work but if I call any other it seems to loop through them all. Its really bizarre
I can post more code if needed.
But any ideas on how to handle the commands being sent to my server would be great
*cheers