hola no entiendo porque razon mi servidor
#servidor
import socket
host = "127.0.0.1"
port = 6666
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print ("Socket Created")
sock.bind((host, port))
print ("socket bind complete")
sock.listen(1)
print ("socket now listening")
while 1:
conn, addr = sock.accept()
datos = conn.recv(4096)
print(datos.decode('UTF-8'))
conn.send("esto es un mensaje de bienvenida".encode('UTF-8'))
el mensaje no llega a mi cliente
#cliente
import socket
host = "127.0.0.1"
port = 6666
sock = socket.socket()
sock.connect((host, port))
while True:
message = input("envia un mensaje")
sock.send(message.encode('utf-8'))
conn, addr = sock.accept()
datos = conn.recv(4096)
print (datos.decode('utf-8'))
if message == "quit":
break
print("bye")
sock.close()
output:
traceback (most recent call last) file "client.py", line 16 in conn, addr = sock.accept()
file "f:\python\lib\socket.py", line 205 in accept fd, addr = self.accept()
OSerror = [winerror 10022] se ha proporcionado un argumento no valido