Document last modified:
Adds resend of any chat received from another chatter to all chatters in list
except sender of the chat (Download).
Message loops occur if chat sent to back to chatter.
# chat3 from socket import * class receiver(threading.Thread) : self.RECEIVERPORT = receiverPort def run(self) : # Add new chatters to list for toName in self.CHATLIST : self.SOCKET.close() ioSocket=socket(AF_INET, SOCK_DGRAM) if len(sys.argv)>1 : toName = sys.argv[1] try : print 'chat3 on port ', ioPort, '. Blank line to quit.' chatList=[toName] receiver(ioSocket, chatList, receiverPort).start() while True : # Send in main thread |