Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import socket
- s = socket.socket()
- endpoint = ('localhost', 28813)
- s.bind((endpoint))
- # listen for connections, accept 0 connections kept waiting (backlog)
- # all other connect()s should block indefinitely
- s.listen(0)
- for i in range(1,1000):
- c = socket.socket()
- c.connect(endpoint)
- # print number of successfully connected sockets
- print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement