users@grizzly.java.net

How does a grizzly-based server push to client just after accepting the client's connecting?

From: JianXing Yi <jianxing.yi_at_gmail.com>
Date: Sun, 15 Jun 2008 20:45:27 +0800

Hi there,

Think about RFC865, the quote of day protocol. The server sends the quote of
day to the client once accepted the client's connecting. I use a protocol
chain to implement the server. It seems that the server's protocol chain
executed only when it received data from client. In another word, the
server's protocol chain execution is triggered by a SelectionKey.OP_READ
event by default, I think. Can I change it to SelectionKey.OP_WRITE so that
the server could initiate the interaction with the client?

The attached is the server's code. I tried it with the TELNET command line.
It showed that the command line has to input to initiate the interaction,
otherwise it could not get the push from the server.

Any help is highly appreciated!

Regards,
-Yi Bing