while ((request = session.readRequest()) != null) {
final String reqCmd = request.getCommand();
final String reqArg = request.getArgument();
final Command command = Commands.get(reqCmd);
if (command != null) {
command.invoke(session, reqArg);
} else {
session.replyWithSpace(500, "Command {} isn't supported", reqCmd);
}
session.setLastRequest(request);
}