users@grizzly.java.net

Re: Should I use Context to store the clients references ?

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Wed, 16 Jul 2008 17:12:47 +0200

Pls. try attached version.

WBR,
Alexey.


On Jul 16, 2008, at 15:45 , Survivant 00 wrote:

> I got a exception when I send the second request
>
> it's really simple to reproduce
>
> start the main class
>
> GrizzlyGateway
>
> it will listen on the port 5000
>
>
> open a telnet localhost 5000
>
> in the console.. send theses 2 requests.. One by one
>
> feed|aaa[eoq]
> feed|bbb[eoq]
>
>
> you will see that in the server console
>
>
> GrizzlyGateway started
> Simulate a disconnection from the 3th party
> Reconnecting...
> listening for incomming TCP Connections on port : 5000
> query = feed|aaa
> SENDING FEED TO CLIENT = [SYMBOL=[aaa] BID = 31.46111239671892| ASK
> = 41.85483961272104]
> SENDING FEED TO CLIENT = [SYMBOL=[aaa] BID = 19.410604221055426| ASK
> = 40.98782811588009]
> 2008-07-16 09:41:07 com.sun.grizzly.DefaultProtocolChain
> executeProtocolFilter
> GRAVE: ProtocolChain exception
> java.lang.IllegalStateException: ByteBuffer is full:
> java.nio.HeapByteBuffer[pos=0 lim=0 cap=8192]
> at com.sun.grizzly.filter.ReadFilter.execute(ReadFilter.java:120)
> at com.sun.grizzly.filter.ReadFilter.execute(ReadFilter.java:95)
> at
> com
> .sun
> .grizzly
> .filter.ParserProtocolFilter.execute(ParserProtocolFilter.java:108)
> at
> com
> .sun
> .grizzly
> .DefaultProtocolChain
> .executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com
> .sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
> 104)
> at
> com
> .sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
> 90)
> at
> com
> .sun
> .grizzly
> .ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
> at
> com
> .sun
> .grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
> at
> com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:169)
> SENDING FEED TO CLIENT = [SYMBOL=[aaa] BID = 10.932414591862527| ASK
> = 25.136572649558214]
>
>
>
>
>
>
>
>
>
> 2008/7/16 Oleksiy Stashok <Oleksiy.Stashok_at_sun.com>:
> Hi,
>
> I made some changes to the parser code - please try it.
> The idea is to not use internal bytebuffer in the parser, but reuse
> one from WorkerThread...
> Let me know if it works, if not - please provide some unit test,
> using which I can test the parser myself.
>
> Thank you.
>
> WBR,
> Alexey.
>
>
>
> <
> nio_quotestock_demo_v3
> .zip
> >---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net