Handling received messages directly in the Client (using nio trough the netty-framework)

StackOverflow https://stackoverflow.com/questions/7412564

  •  30-10-2019
  •  | 
  •  

Question

I have made an client - server example using netty. I have defined handlers for the server and the client. Basically I connect with the client to the server and send some messages. Every received message gets send back (with the content of the message being converted to upper case). All the work on the received messages, on server and client-side, is done by the defined handlers.

But I would like to use, or better receive/accept, some of the messages directly in the client not (just) in the handler. So my question is is it possible to have some listener to receive messages directly in the client-program and not in its handlers. The thin is I would like to access the received messages within the (executable) program (basically the class with a main method) that created a new client object, using something like a timer which (or a loop) which would periodically check for new messages.

I would appreciate if someone could help me with this issue. Or at least tell me if its even possible with netty .

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top