'Returns current (port, server index) pairs.
:returns: A set of (port, server_idx) tuples for currently-tracked
ports, sockets, and PIDs.'

def port_index_pairs(self):

    current_port_index_pairs = set()
    for (port, pid_state) in self.sock_data_by_port.items():
        current_port_index_pairs |= set(((port, i) for (i, pid) in enumerate(pid_state['pids']) if (pid is not None)))
    return current_port_index_pairs
