if (ch.socket().getTrafficClass() != cfg.getTrafficClass()) {
ch.socket().setTrafficClass(cfg.getTrafficClass());
}
ch.configureBlocking(false);
ch.socket().bind(req.address);
if (req.address == null || req.address.getPort() == 0) {
req.address = (InetSocketAddress) ch.socket()
.getLocalSocketAddress();
}
ch.register(selector, SelectionKey.OP_READ, req);