Code example for ServerSocketChannel

Methods: close

0
	 * when we start as client, close server, if existing due to linger connection. 
	 */ 
	public void closeServer() { 
		if( mServerSocketChannel != null ){
			try{ 
				mServerSocketChannel.close();
				mServerSelector.close();
			}catch(Exception e){
				 
			}finally{ 
				mApp.mIsServer = false;
				mServerSocketChannel = null;
				mServerSelector = null;
				mServerAddr = null;
				mClientChannels.clear();
			} 
		} 
	} 
	 
	public void closeClient() { 
Experience pair programming with AI  Get Codota for Java