users@grizzly.java.net

Re: handleAccept/handleWrite in FilterAdapter

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Sun, 10 May 2009 01:20:47 +0200

Hi Nick,

>
> When a client connects, handleRead sits and waits for the client to
> push something to the port before sending it along the filterchain.
> I need to immediately send the client a 'greeting' when it connects.
> After this, the client initialises the dialog between server and
> client.
>
> I tried setting up the greeting in handleAccept -> streamWriter =
> null.
I've fixed this. Now context has read/writer values.

> I tried setting up the greeting in handleWrite and the call never
> came.
Right, by default we don't register connection to notify Grizzly about
OP_WRITE operation. Currently it could be done via lower level
SelectorHandler API
(NIOTransport.getSelectorHandler().registerKey(....)), thought we
could think about something more simple.

Thanks.

WBR,
Alexey.

>
>
> Is there a solution to this?
>
> Cheers
>
> Nick
>
> Surfing the web just got more rewarding. Download the New Internet
> Explorer 8