def _tcp_listener(address, backlog=50, reuse_addr=None, family=_socket.AF_INET):
 sock = socket(family=family)
 if (reuse_addr is not None):
  sock.setsockopt(_socket.SOL_SOCKET, _socket.SO_REUSEADDR, reuse_addr)
 try:
  sock.bind(address)
 except _socket.error:
  ex = sys.exc_info()[1]
  strerror = getattr(ex, 'strerror', None)
  if (strerror is not None):
   ex.strerror = ((strerror + ': ') + repr(address))
  raise
 sock.listen(backlog)
 sock.setblocking(0)
 return sock

def _tcp_listener ( address , backlog = 50 , reuse_addr = None , family = _socket . AF_INET ) : sock = socket ( family = family ) if ( reuse_addr is not None ) : sock . setsockopt ( _socket . SOL_SOCKET , _socket . SO_REUSEADDR , reuse_addr ) try : sock . bind ( address ) except _socket . error : ex = sys . exc_info ( ) [ 1 ] strerror = getattr ( ex , 'strerror' , None ) if ( strerror is not None ) : ex . strerror = ( ( strerror + ': ' ) + repr ( address ) ) raise sock . listen ( backlog ) sock . setblocking ( 0 ) return sock
a shortcut to create a tcp socket .