receiving data over a python socket -
i'm making program retrieves decently large amounts of data through python socket , disconnects when information finished sending. i'm not sure how this
all examples on web of tcp clients have
while 1: data = sock.recv(1024) but creates infinite loop receive data via socket, not?
i need figure out size of message coming in , loop through in buffer-sized increments full message. , after message has finished sending, disconnect, although think connection closed other end. nice
thanks
you've missed important part of examples - lines follow "recv()" call:
while 1: data = conn.recv(1024) if not data: break conn.send(data) conn.close()
Comments
Post a Comment