Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- import threading
- import time
- host = '10.90.78.40'
- port = 56983
- aidhost = '10.90.78.41'
- aidport = 50009
- def listen():
- with socket.socket(socket.AF_INET,socket.SOCK_STREAM) as s:
- s.bind((host,port))
- s.listen(3)
- while True:
- conn, addr = s.accept()
- print("Connected by",addr)
- threading.Thread(target=reply_message, args=(conn,)).start()
- def reply_message(conn):
- with conn:
- while True:
- data = conn.recv(1024)
- if data:
- conn.sendall(data)
- print(data.decode())
- listen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement