le.dahut at laposte.net
Tue Jan 24 06:39:54 EST 2006
I have a server that receives data from a client, detect the end of this
data and send other data back to the client (it's to measure bandwidth).
I think the best way is to thread a part of the server's program am I
HOST = socket.gethostname()
PORT = int(sys.argv)
PORT = 50009
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "s.bind((", HOST, PORT, "))"
conn, addr = s.accept()
print 'Connected by', addr
data += conn.recv(1024)
if data[-5:] == '#####': #the end of the data
data2=data2[:-5]+'#####' #the end of the data
Fredrik Lundh a écrit :
> "le dahut" wrote:
>>I've read the Gordon McMillan's "Socket Programming HOWTO" and I'm
>>looking for other documents that show examples on how to write a socket
>>server that can answer multiple clients at the same time.
>>Does someone know where I can find those documents/tutorials ?
> or google for "twisted".
More information about the Python-list