Skip to the content.

Home / cs-notes / Architecture / Components / Netty / Summary / bootstrap / register



public final SelectionKey register(Selector sel, int ops, Object att)
    throws ClosedChannelException
{
    ...
    SelectionKey k = findKey(sel);
    if (k != null) {
        k.attach(att);
        k.interestOps(ops);
    } else {
        // New registration
        k = ((AbstractSelector)sel).register(this, ops, att);
        addKey(k);
    }
    ...
}