public Future < Void > startAsync ( ) { log . info ( "Session store / pubsub factory used: {}" , configCopy . getStoreFactory ( ) ) ; initGroups ( ) ; pipelineFactory . start ( configCopy , namespacesHub ) ; Class < ? extends ServerChannel > channelClass = NioServerSocketChannel . class ; if ( configCopy . isUseLinuxNativeEpoll ( ) ) { channelClass = EpollServerSocketChannel . class ; } ServerBootstrap b = new ServerBootstrap ( ) ; b . group ( bossGroup , workerGroup ) . channel ( channelClass ) . childHandler ( pipelineFactory ) ; applyConnectionOptions ( b ) ; InetSocketAddress addr = new InetSocketAddress ( configCopy . getPort ( ) ) ; if ( configCopy . getHostname ( ) != null ) { addr = new InetSocketAddress ( configCopy . getHostname ( ) , configCopy . getPort ( ) ) ; } return b . bind ( addr ) . addListener ( new FutureListener < Void > ( ) { @ Override public void operationComplete ( Future < Void > future ) throws Exception { if ( future . isSuccess ( ) ) { log . info ( "SocketIO server started at port: {}" , configCopy . getPort ( ) ) ; } else { log . error ( "SocketIO server start failed at port: {}!" , configCopy . getPort ( ) ) ; } } } ) ; }
Start server asynchronously