def listen_on_socket(self, socket_name=None):
def connection_cb(pipe_connection):<EOL><INDENT>with context():<EOL><INDENT>connection = ServerConnection(self, pipe_connection)<EOL><DEDENT>self.connections.append(connection)<EOL><DEDENT>self.socket_name = bind_and_listen_on_socket(socket_name, connection_cb)<EOL><INDENT>if '<STR_LIT:.>' in self.socket_name:<EOL><INDENT>self.session_name = self.socket_name.rpartition('<STR_LIT:.>')[-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>logger.info('<STR_LIT>' % self.socket_name)<EOL>return self.socket_name<EOL>
Listen for clients on a Unix socket.
Returns the socket name.