if ( key == null ) return;
NioChannel nch = key.getChannel();
if ( nch == null ) return;
SocketChannel ch = nch.getIOChannel();
if ( ch == null ) return;
SelectionKey sk = ch.keyFor(selector);
try {
if (sk == null) {
sk = ch.register(selector, ops, key);
ref.key = sk;
} else if (!sk.isValid()) {