socket problem (send infinite...)

A

Alberto Vera

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`
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
FloridaHan

Latest Threads

Top