users@grizzly.java.net

Re: How to implement the client's message flow based on async read/write?

From: JianXing Yi <jianxing.yi_at_gmail.com>
Date: Fri, 13 Jun 2008 14:10:48 +0800

Hello John,
Great thanks for your help! European soccer champinship also attract lot of
us :-) Enjoy! It's really a good news for your samples, the sooner the
better :-)
In my case, I invoke the ProtocolFilter in CallbackHandler.onConnect() to
send the request to the server and it works, or in another word, the
CallbackHandler.onConnect() kicks off the protocol interaction. Because I
really want the ProtocolFilter to manage its own state/operation itselft
without interaction with the CallbackHandler.
But there are still problems, those are about
1. Context operation type switching or SelectionKey interests switching
Could you pls. give a brief explanation of these switching, maybe something
about Context.setCurrentOpType(), KeyRegistrationState, or anything else?
2. Asynchronously reading/writing in ProtocolFilters
In my case, I use an asynchronous reading operaiton to receive the server's
simple response. Unfortunately, this leads to about 50% cpu polling :-(.
3. State management in ProtocolFilter
In my case, I try to test a stateful protocol interaction by extending the
interaction process to this: the request-response interaction will be
repeated 5 times and then the client initiates to close the connection.
Could you pls. give a brief explanation about how to implement state
management in ProtocolFilter?

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

> ProtocolParser,Filter are mainly for reading.
> Of course you can always call your TCPConnectorHandler from a filter.
>
> you could look at
>
> "Obtaining the selectorHandler for a given ConnectorHandler"
>
> https://grizzly.dev.java.net/servlets/ReadMsg?listName=users&msgNo=678
>
> for advice on setting up a chain in a client for reading.
>
> many Greetings.
> p.s:
> I am working on a complete example for client/server communication
> with a client protocolParser
> and will try to publish it under the samples directory.
> I should have it done at the end of the month after the european soccer
> championship...
>
>
>
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>