SHARE
TWEET

Untitled

a guest Feb 27th, 2020 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import socket
  2. import threading
  3.  
  4. def al(conn):
  5.     while True:
  6.         data = conn.recv(1024)
  7.         print("Alınan mesaj", data.decode("utf-8"))
  8.        
  9.  
  10.  
  11. host = '127.0.0.1'
  12. port = 90
  13.  
  14. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  15.  
  16. s.bind((host, port))
  17.  
  18. s.listen()
  19.  
  20. conn,addr = s.accept()
  21.  
  22.  
  23. a = threading.Thread(target=al, args=(conn,))
  24. a.start()
  25.  
  26. #print("ip:", conn, "addr:", addr)
  27. while True:
  28.     mesaj = str(input())
  29.     conn.sendall(mesaj.encode("utf-8"))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top