Code example for SocketChannel

Methods: close, isOpen

0
	 
	private void cleanUp() { 
 
		try { 
	 
			if (sockChannel != null && sockChannel.isOpen())
				sockChannel.close();
			if (timer != null)
				timer.cancel();
		} catch (IOException e) {
			e.printStackTrace();
		} 
		 
		keepRunning = false;
	} 
 
	 
	private class UploadTask extends TimerTask{
 
		private File [] listFiles;
		private int counter;