>> >>So what if the client sends 4 bytes, and then sends 8000 bytes? WIll I >>get the first 4 bytes as a separate msg so to speak? Basically i want >>to catch each message from the client as a whole. >>
IF YOU WANT SEPARATE MESSAGES: Modify the client to send an end of record, then: On Server: datasep = '<EOR>' # or whatever you like datal = [] seversocket.settimeout(5.0) # or 0(infinite) or something reasonable while 1: try: data = serversocket.recv(BUFFERSIZE) # fails on timeout if not data: break datal.append(data) except: break msglist = datal.split(datasep) # a list of messages -- http://mail.python.org/mailman/listinfo/python-list