@Override
    public synchronized void start() {
        Log.debug("Running Netty on port: {}", getPort());

        try {
            // ServerBootstrap is a helper class that sets up a server
            ServerBootstrap serverBootstrap = new ServerBootstrap();
            serverBootstrap.group(parentGroup, childGroup)
                // Instantiate a new Channel to accept incoming connections.
                .channel(NioServerSocketChannel.class)
                // The handler specified here will always be evaluated by a newly accepted Channel.
                .childHandler(new NettyServerInitializer(configuration, allChannels, channelHandlerFactories))
                // Set the listen backlog (queue) length.
                .option(ChannelOption.SO_BACKLOG, JiveGlobals.getIntProperty("xmpp.socket.backlog", 50))
                // option() is for the NioServerSocketChannel that accepts incoming connections.
                // childOption() is for the Channels accepted by the parent ServerChannel,
                // which is NioSocketChannel in this case.
                .childOption(ChannelOption.SO_KEEPALIVE, true)
                // Setting TCP_NODELAY to false enables the Nagle algorithm, which delays sending small successive packets
                .childOption(ChannelOption.TCP_NODELAY, JiveGlobals.getBooleanProperty( "xmpp.socket.tcp-nodelay", true))
                // Set that it will be possible to bind a socket if there is a connection in the timeout state.
                .childOption(ChannelOption.SO_REUSEADDR, true);

            final int sendBuffer = JiveGlobals.getIntProperty( "xmpp.socket.buffer.send", -1 );
            if ( sendBuffer > 0 ) {
                // SO_SNDBUF = Socket Option - Send Buffer Size in Bytes
                serverBootstrap.childOption(ChannelOption.SO_SNDBUF, sendBuffer);
            }
            final int receiveBuffer = JiveGlobals.getIntProperty( "xmpp.socket.buffer.receive", -1 );
            if ( receiveBuffer > 0 ) {
                // SO_RCVBUF = Socket Option - Receive Buffer Size in Bytes
                serverBootstrap.childOption(ChannelOption.SO_RCVBUF, receiveBuffer);
            }
            final int linger = JiveGlobals.getIntProperty( "xmpp.socket.linger", -1 );
            if ( linger > 0 ) {
                serverBootstrap.childOption(ChannelOption.SO_LINGER, linger);
            }

            // Bind to the port and start the server to accept incoming connections.
            this.mainChannel = serverBootstrap.bind(
                    new InetSocketAddress(
                        configuration.getBindAddress(),
                        configuration.getPort())
                )
                .sync()
                .channel();

        } catch (InterruptedException e) {
            Log.error("Error starting: " + configuration.getPort(), e);
            closeMainChannel();
        }
    }
Starts this acceptor by binding the socket acceptor. When the acceptor is already started, a warning will be
logged and the method invocation is otherwise ignored.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/NettyConnectionAcceptor.java