Advertisement
Guest User

Untitled

a guest
Feb 18th, 2023
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import socket, threading, time, asyncio
  2.  
  3. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  4. sock.bind(("192.168.50.49", 7777))
  5. sock.listen(5)
  6.  
  7. print("waiting for connectinos ...")
  8.  
  9. cli, addr = sock.accept()
  10. print(addr)
  11.  
  12. while 1:
  13. valv = input(">")
  14. data = valv.split(" ")
  15. if data[0] == "recv":
  16. print(cli.recv(1024).decode())
  17. cli.send("1".encode())
  18. continue
  19. cli.send(valv.encode())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement