private void rebuildSelector ()
    {
        Selector newSelector;

        try {
            newSelector = Selector.open();
        } catch (IOException e) {
            throw new ZError.IOException(e);
        }

        try {
            selector.close ();
        } catch (IOException e) {
        }

        selector = newSelector;

        for (PollSet pollSet : fd_table.values ()) {
            pollSet.key = null;
        }

        retired = true;
    }