Code example for ServerSocketChannel

Methods: close

0
	public static void stop() throws IOException 
	{ 
		System.out.println("Server shutting down, ran for " + ((float)runTimer.elapsed() / 3600000f) + " hours");
		networkThread.interrupt();
		selector.close();
		channel.close();
		System.exit(0);
	} 
	 
	private static void run() 
	{ 
		networkThread = new Thread()
		{ 
			@Override 
			public void run() 
			{ 
				setName("network");
				System.out.println("Network thread started");
				 
				while (!interrupted())
				{