##// END OF EJS Templates
imanay -
r53:54
parent child
Show More
@@ -1,14 +1,18
1 import socket No newline at end of file
1 import socket
2 No newline at end of file
2
3 #host = "localhost"
No newline at end of file
4 host = "192.168.1.117"
No newline at end of file
5 #host = "192.168.1.100" No newline at end of file
3 s = socket.socket()
6 s = socket.socket()
No newline at end of file
7 s.connect((host, 5500)) No newline at end of file
4 s.connect(("localhost", 5500)) No newline at end of file
5 No newline at end of file
8
6 while True: No newline at end of file
9 while True:
7 mensaje = raw_input("> ") No newline at end of file
10 mensaje = raw_input("> ")
8 s.send(mensaje) No newline at end of file
11 s.send(mensaje)
9 if mensaje == "quit": No newline at end of file
12 if mensaje == "quit":
10 break
13 break
No newline at end of file
14 recibido = s.recv(1024)
11 No newline at end of file
No newline at end of file
15 print "Recibido:", recibido No newline at end of file
12 print "adios" No newline at end of file
16 print "adios"
13 No newline at end of file
17
14 s.close() No newline at end of file
18 s.close()
@@ -1,7 +1,8
1 import socket No newline at end of file
1 import socket
2 No newline at end of file
2
3 host = "192.168.1.117" No newline at end of file
3 s = socket.socket()
4 s = socket.socket()
No newline at end of file
5 s.bind((host, 5500)) No newline at end of file
4 s.bind(("localhost", 5500)) No newline at end of file
5 s.listen(1) No newline at end of file
6 s.listen(1)
6 No newline at end of file
7
7 sc, addr = s.accept() No newline at end of file
8 sc, addr = s.accept()
General Comments 0
You need to be logged in to leave comments. Login now