en mi anterior pregunta tuve un error con la clase socket y ahora tengo otro error
server
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()
print ('Connected with ') + addr[0] + ':' + str(addr[1])
sock.close()
output
Socket Created
socket bind complete
socket now listening
Connected with
traceback (most recent call last):
file "server.py", line 18 in <module>
print("connected with") + addr[0] + ":" str(addr[1])
typeError : unsupported operand type(s) for +: 'NoneType' and 'str'
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'))
if message == "quit":
break
print("bye")
sock.close()