def set_select_fds(self, connection):
        """Set the set of sockets for select based on connection.select_fds.

        If connection had previous fds being used those are removed and replaced with the
        current set in select_fds.
        """
        self._remove_fds(connection)
        new_fds = connection.select_fds
        self.fds[connection] = new_fds
        r, w, x = new_fds
        self.read_fds.update(r)
        self.write_fds.update(w)
        self.ex_fds.update(x)
        for fd in set(r + w + x):
            self.connections[fd] = connection
Set the set of sockets for select based on connection.select_fds.

        If connection had previous fds being used those are removed and replaced with the
        current set in select_fds.
        
nogotofail/mitm/connection/server.py