users@grizzly.java.net

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

From: Survivant 00 <survivant00_at_gmail.com>
Date: Wed, 16 Jul 2008 09:45:40 -0400

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.
>
>
>