Commit d69f4255 authored by Denis Bilenko's avatar Denis Bilenko

gevent.socket: remove bind_and_listen and tcp_listener

parent d5070af2
......@@ -579,23 +579,6 @@ else:
__implements__.remove('fromfd')
def bind_and_listen(descriptor, address=('', 0), backlog=50, reuse_addr=True):
if reuse_addr:
try:
descriptor.setsockopt(SOL_SOCKET, SO_REUSEADDR, descriptor.getsockopt(SOL_SOCKET, SO_REUSEADDR) | 1)
except error:
pass
descriptor.bind(address)
descriptor.listen(backlog)
def tcp_listener(address, backlog=50, reuse_addr=True):
"""A shortcut to create a TCP socket, bind it and put it into listening state."""
sock = socket()
bind_and_listen(sock, address, backlog=backlog, reuse_addr=reuse_addr)
return sock
try:
_GLOBAL_DEFAULT_TIMEOUT = __socket__._GLOBAL_DEFAULT_TIMEOUT
except AttributeError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment