users@grizzly.java.net

Re: ProtocolParser Advice

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Mon, 19 May 2008 16:58:35 +0200

Hello John,

your implementation looks very good!
One suggestion I can have is to not save temporary packet data inside
IncomingMessage... This way what you do all the time - is copying
bytes from one array to another... this operation is enough expensive.
I always suggest to avoid copying if it's possible.
Please take a look at this thread [1]. Ken and myself worked on
improving original custom Parser implementation, which copied a lot
and came to better (IMHO) solution, which avoids copying.
If you will have any question on that - you're welcome :)

Thanks.

WBR,
Alexey.

[1] http://www.nabble.com/ProtocolParser-implementation-II-tt17152654.html

On May 19, 2008, at 14:37 , John ROM wrote:

> Hello,
> I wrote my first ProtocolParser (-:
>
> I've attached a Testcase with the Parser in it.
>
> I would just like to have some Feedback?
> You know maybe just get some hints if I'm doing the right thing!
> Or are there better ways?
>
> I really would appreciated any advice.
>
>
> The CustomProtocol Parser (see attached Testcase) is supposed to
> parse a "12 bytes Header + Data" Protocol.
>
> My usecase would be an Application where about 100 Clients connect
> concurrently to one Server. Each Client should only have one long
> lasting connection to the server.
>
> In the attached Testcase I kept the Exception handling very simple
> (for example don't care about timeouts)
>
>
> Many Greetings
> John
>
>
>
>
> --
> 249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro.
> Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de
> <
> ProtocolParserStateTest
> .java
> >---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net