We will remove boiler plate code and concentrate on the important constructs. Below the code for the Client :

publicstaticvoidmain(String[]args)throwsThrowable{NioSocketConnectorconnector=newNioSocketConnector();connector.setConnectTimeoutMillis(CONNECT_TIMEOUT);if(USE_CUSTOM_CODEC){connector.getFilterChain().addLast("codec",newProtocolCodecFilter(newSumUpProtocolCodecFactory(false)));}else{connector.getFilterChain().addLast("codec",newProtocolCodecFilter(newObjectSerializationCodecFactory()));}connector.getFilterChain().addLast("logger",newLoggingFilter());connector.setHandler(newClientSessionHandler(values));IoSessionsession;for(;;){try{ConnectFuturefuture=connector.connect(newInetSocketAddress(HOSTNAME,PORT));future.awaitUninterruptibly();session=future.getSession();break;}catch(RuntimeIoExceptione){System.err.println(&quot;Failedtoconnect.&quot;);e.printStackTrace();Thread.sleep(5000);}}// wait until the summation is donesession.getCloseFuture().awaitUninterruptibly();connector.dispose();}

IoSessionsession;for(;;){try{ConnectFuturefuture=connector.connect(newInetSocketAddress(HOSTNAME,PORT));future.awaitUninterruptibly();session=future.getSession();break;}catch(RuntimeIoExceptione){System.err.println("Failed to connect.");e.printStackTrace();Thread.sleep(5000);}}

Here is the most important stuff. We connect to remote Server. Since, connect is an async task, we use the ConnectFuture class to know the when the connection is complete.
Once the connection is complete, we get the associated IoSession. To send any message to the Server, we shall have to write to the session. All responses/messages from server shall traverse the Filter chain and finally be handled in IoHandler.