code: def bind_and_listen_on_posix_socket(socket_name, accept_callback):
      
      assert socket_name is None or isinstance(socket_name, six.text_type)
      assert callable(accept_callback)
  
      # Py2 uses 0027 and Py3 uses 0o027, but both know
      # how to create the right value from the string '0027'.
      old_umask = os.umask(int('0027', 8))
  
      # Bind socket.
      socket_name, socket = _bind_posix_socket(socket_name)
  
      _ = os.umask(old_umask)
  
      # Listen on socket.
      socket.listen(0)
  
      def _accept_cb():
          connection, client_address = socket.accept()
          # Note: We don't have to put this socket in non blocking mode.
          #       This can cause crashes when sending big packets on OS X.
  
          posix_connection = PosixSocketConnection(connection)
  
          accept_callback(posix_connection)
  
      get_event_loop().add_reader(socket.fileno(), _accept_cb)
  
      logger.info('Listening on %r.' % socket_name)
      return socket_name
docs: :param accept_callback: Called with `PosixSocketConnection` when a new
          connection is established.