diff --git a/sockets/cliente_tcp.py b/sockets/cliente_tcp.py index f7cdced..c38a583 100644 --- a/sockets/cliente_tcp.py +++ b/sockets/cliente_tcp.py @@ -5,11 +5,11 @@ from socket import * cliente = socket(AF_INET,SOCK_STREAM) #Abrir conexão -conexao = cliente.connect(("127.0.0.1",3000)) +conexao = cliente.connect(("10.209.1.45",3000)) #Enviar mensagem -cliente.send("Olá, servidor!".encode()) +cliente.send("Olá, servidor! Aqui é o Simon".encode()) # mensagem = cliente.recv(1024) -print(f"MEnsagem recebida {mensagem.decode()}") \ No newline at end of file +print(f"Mensagem recebida {mensagem.decode()}") \ No newline at end of file diff --git a/sockets/servidor_tcp.py b/sockets/servidor_tcp.py index 0ea734b..7226d22 100644 --- a/sockets/servidor_tcp.py +++ b/sockets/servidor_tcp.py @@ -7,6 +7,8 @@ servidor = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #Estabelecer vinculo com endereço e uma porta servidor.bind(("127.0.0.1",3000)) +print("Servidor inicializando...") + #Começa a ouvir tentativas de conexão servidor.listen()