M
Maxim Veksler
Hi,
I'm trying to write a non blocking socket port listener based on
poll() because select is limited to 1024 fd.
Here is the code, it never gets to "I did not block" until I do a
telnet connection to port 10000.
"""
#!/usr/bin/env python
import socket
import select
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setblocking(0)
s.bind(('0.0.0.0', 10000))
s.listen(5)
__poll = select.poll()
__poll.register(s)
__poll.poll()
print "I did not block"
"""
I'm trying to write a non blocking socket port listener based on
poll() because select is limited to 1024 fd.
Here is the code, it never gets to "I did not block" until I do a
telnet connection to port 10000.
"""
#!/usr/bin/env python
import socket
import select
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setblocking(0)
s.bind(('0.0.0.0', 10000))
s.listen(5)
__poll = select.poll()
__poll.register(s)
__poll.poll()
print "I did not block"
"""