// if (requestCode != Constants.CMSG_HEARTBEAT) {
// System.out.println("Request code is : " + requestCode);
// }
GameRequest request = GameRequestTable.get(requestCode);
//If the request if valid, process like following:
if (request != null) {
request.setGameClient(this);
//Pass the realInputStream to the request object.
request.setDataInputStream(dataInput);
//The request object parses the realInputStream.
request.parse();
//The request object process business.
request.doBusiness();
//Get the response created by the request object.
for (GameResponse response : request.getResponses()) {
//Construct the response from an object to an outputStream.
outputStream.write(response.constructResponseInBytes());
}
// response.printResponse();