def bind_and_listen_on_posix_socket(socket_name, accept_callback):
assert socket_name is None or isinstance(socket_name, six.text_type)<EOL>assert callable(accept_callback)<EOL>old_umask = os.umask(int('<STR_LIT>', <NUM_LIT:8>))<EOL>socket_name, socket = _bind_posix_socket(socket_name)<EOL>_ = os.umask(old_umask)<EOL>socket.listen(<NUM_LIT:0>)<EOL>def _accept_cb():<EOL><INDENT>connection, client_address = socket.accept()<EOL>posix_connection = PosixSocketConnection(connection)<EOL>accept_callback(posix_connection)<EOL><DEDENT>get_event_loop().add_reader(socket.fileno(), _accept_cb)<EOL>logger.info('<STR_LIT>' % socket_name)<EOL>return socket_name<EOL>
:param accept_callback: Called with `PosixSocketConnection` when a new
    connection is established.