Code example for SocketChannel

Methods: registercloseconfigureBlocking

0
            return;   
        }   
           
        SelectionKey clientKey = null;  
        try {  
            client.configureBlocking(false);  
            clientKey = client.register(selector, SelectionKey.OP_READ);  
            clientKey.attach(new ClientHandler());  
        } catch (IOException e) { 
        	if (null != clientKey) {
        		clientKey.cancel();
        	} 
            try { client.close(); } catch (IOException ioe) { Logger.except(ioe); }  
        }  
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java