Code example for SocketChannel

Methods: configureBlocking, register

0
		this.id = id;
		socketHandler = new ClientSocketHandler(channel);
		commandQueue = new LinkedList<ModuleCommand>();
	} 
 
	/** 
	 * Client loop: Reads, parses and executes commands until the client disconnects or there is an error 
	 */ 
	@Override 
	public void run() 
	{ 
clientLoop: 
		while (true) { 
			if (!socketHandler.readFromSocket()) {
				System.out.println("Client #" + id + " disconnecting.");
				break clientLoop; 
			} 
 
			try { 
				server.getCommandParser().parseClientCommands(this, socketHandler.getReadBuffer());
			} catch (CommandParseError cpe) {