private static ServerSocketChannel createServerSocketChannel(Spec spec) throws ListenFailedException {
        ServerSocketChannel serverChannel = null;
        try {
            serverChannel = ServerSocketChannel.open();
            serverChannel.configureBlocking(true);
            if (spec.port() != 0) {
                serverChannel.socket().setReuseAddress(true);
            }
            serverChannel.socket().bind(spec.resolveAddress(), 500);
        } catch (Exception e) {
            if (serverChannel != null) {
                try { serverChannel.socket().close(); } catch (Exception ignore) {}
            }
            throw new ListenFailedException("Failed to listen to " + spec, e);
        }
        return serverChannel;
    }
A class used to listen on a network socket. A separate thread is
used to accept connections and register them with the underlying
transport thread. To create an acceptor you need to invoke the
{@link Supervisor#listen listen} method in the {@link Supervisor}
class.
jrt/src/com/yahoo/jrt/Acceptor.java