socket problem (send infinite...)

Alberto Vera avera at coes.org.pe
Mon Jun 28 17:49:05 CEST 2004


Hello:I found an example to send data using socket.I did a little change for code you can find in: http://www.python.org/doc/current/lib/socket-example.htmlI want to send a lot of Hello World, but after few seconds I didn't see any new "Hello World" Client side sends 3577 "Hello World" and Server side shows 1800 "Hello World" Could you tell me How I can improve this?Thanks...# Echo client program
import socket

HOST = 'daring.cwi.nl'    # The remote host
PORT = 50007              # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))#changes!!!j=0while 1:   info1 = "*Hello World=\'%s\'"%(str(j)) 
   s.send(info1)   j+=1
   data = s.recv(1024)s.close()
print 'Received', `data`
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20040628/3cf43905/attachment.html>


More information about the Python-list mailing list