private void closeChannels() {
		try {
			if (serverSocketChannel != null && serverSocketChannel.isOpen())
				serverSocketChannel.close();
			if (datagramChannel != null && datagramChannel.isOpen())
				datagramChannel.close();
			if (stdin != null && stdin.isOpen())
				stdin.close();
		} catch (IOException e) {
			e.printStackTrace();
		}	
	}