In Python, in the module socket
there are two functions: send()
and sendall()
, both have the same parameters and the documentation of both is quite similar that I do not fully understand what differences there are between one and another one since at least for me it seems that they do the same thing.
from socket import *
s=socket(AF_INET,SOCK_STREAM)
s.bind(("",9000))
s.listen(5)
while True:
c,a=s.accept()
print "servidor \n"
print "recived connection from ", a
dat=c.recv(1000)
c.sendall("hello %s\n"%a[0])
c.send("hola")
print c.recv(1000)
c.close()