Ejemplo n.º 1
0
  /**
   * a message was received from the server. Here we dispatch the message to the client's thread
   * pool to minimize the time it takes to process other messages.
   *
   * @param ctx The channel the message was received from
   * @param msg The message
   */
  @Override
  protected void channelRead0(ChannelHandlerContext ctx, eye.Comm.Request msg) throws Exception {
    for (String id : listeners.keySet()) {
      CommListener cl = listeners.get(id);

      // TODO this may need to be delegated to a thread pool to allow
      // async processing of replies

      logger.info("inside channel read() got message from server :" + msg.getHeader().getTag());
      cl.onMessage(msg);
    }
  }