Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. import socket
  4.  
  5. s = socket.socket()
  6. endpoint = ('localhost', 28813)
  7. s.bind((endpoint))
  8. # listen for connections, accept 0 connections kept waiting (backlog)
  9. # all other connect()s should block indefinitely
  10. s.listen(0)
  11.  
  12. for i in range(1,1000):
  13. c = socket.socket()
  14. c.connect(endpoint)
  15. # print number of successfully connected sockets
  16. print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement