public void run() {
		System.out.println("Admin server initialized, listening on port " + m_serverSocket.getLocalPort());
		while( true ) {
			try {
				m_socket = m_serverSocket.accept();

				byte[] buffer = new byte[40960];

				Pattern userPwdPattern =
					Pattern.compile("username:(\\S+)\\s+password:(\\S+)\\s+command:(\\S+)\\sCN:(\\S*)\\s");

				BufferedInputStream in =
					new BufferedInputStream(m_socket.getInputStream(),
											buffer.length);

				// Read a buffer full.
				int bytesRead = in.read(buffer);

				String line =
					bytesRead > 0 ?
					new String(buffer, 0, bytesRead) : "";

				Matcher userPwdMatcher =
					userPwdPattern.matcher(line);

				// parse username and pwd
				if (userPwdMatcher.find()) {
					String userName = userPwdMatcher.group(1);
					String password = userPwdMatcher.group(2);

					if( authenticateUser(userName, password) ) {
						String command = userPwdMatcher.group(3);
						String commonName = userPwdMatcher.group(4);
						doCommand( command );
					} else {
						System.out.println("User " + userName + " unauthenticated.");
					}
				}
			}
			catch( InterruptedIOException e ) {
			}
			catch( Exception e ) {
				e.printStackTrace();
			}
		}
	}