Amount of data that can be transfered between a client and a server.

Jason Orendorff jason at jorendorff.com
Sun Jan 6 14:11:49 EST 2002


> I know that there is a way of doing it, but i dont know how. the server
> dosnt tell me how much data it is going to send. could you please help me
> with this kind of problem.

from socket import *

s = socket(AF_INET, SOCK_STREAM)
s.connect(("ncdm124.lac.uic.edu", 5040))
f = s.makefile('rb')
data = f.read()
f.close()
s.close()

print "read %d bytes of data:" % len(data)
print repr(data)

## Jason Orendorff    http://www.jorendorff.com/





More information about the Python-list mailing list