users@grizzly.java.net

Re: 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: Tue, 17 Jun 2008 09:06:03 +0800

Hi John,

Yes, that is exactly what I want. Many thanks!

Regards,
-Yi Bing

2008/6/15 John ROM <snake-john_at_gmx.de>:

> Hi Yi Bing,
> you could override TCPSelectorHandler :
>
> TCPSelectorHandler sh = new TCPSelectorHandler() {
> public boolean onAcceptInterest(SelectionKey key, Context ctx)
> throws IOException {
> SelectableChannel channel = acceptWithoutRegistration(key);
>
> if (channel != null) {
> configureChannel(channel);
> SelectionKey readKey =
> channel.register(selector,
> SelectionKey.OP_WRITE);
> readKey.attach(System.currentTimeMillis());
> }
> return false;
> }
> };
>
>
> sh.setPort(serverPort);
> controller.setSelectorHandler(sh);
>
> Is that what you wanted?
>
> many greetings
>
> John
>
> --
> Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
> Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>