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

Venkat Venkataraju vvenka1 at
Sun Jan 6 12:52:14 EST 2002

Hi Dave

I'm using the plain old socketsa i belive. i'm very new to sockets and
i tried to call recv() in a while loop till i get all the data. i do
get all the data, but i dont know how i teriminate the while loop.

Here is the lisiting of the code that is used to connec to a special
kind of database server. I'm reciveing 10K of the data and just
printing it. After the client recives all the data, I dont know how to
teriminate the while loop.

from socket import *
import urllib, math, urlparse

s = socket(AF_INET, SOCK_STREAM)
s.connect(("", 5040))

text = s.recv(10240)
print text

text = s.recv(10240)
print text

s.send("metadata expand"+"\n")

text = s.recv(10240)
while 1:
    print text
    text = s.recv(10240)

It would be thankful if you can help me how to recive all the data and
teriminate properly.


More information about the Python-list mailing list