users@grizzly.java.net

Re: Reassembling data in multiple calls to the ProtocolFilter

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Wed, 15 Dec 2010 16:45:42 +0100

Hi,

wanted to advice you to use Grizzly 2.0 RC3, it's API is easier. Here
is the sample you can use to take a look how we encode/decode incoming
bytes into custom message [1]. Specifically in the sample we convert
grizzly Buffer<->GIOPMessage. Most interesting parts for you is
GIOPServer, which has all the init. code and GIOPFilter together with
GIOPEncoder and GIOPEncoder.

The Grizzly 2.0 maven repo is [2], you need just grizzly-framework
module.

If you'd have more questions - please ask.

WBR,
Alexey.

[1] http://java.net/projects/grizzly/sources/svn/show/branches/2dot0/code/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/filterchain
[2] http://download.java.net/maven/glassfish/org/glassfish/grizzly/

On Dec 15, 2010, at 13:50 , GarthW wrote:

>
> If the data in a socket read is too large for a single call to the
> execute
> method in a Custom Protocol filter, how to I maintain state and
> reassemple
> all the parts, of the multiple reads, once the socket is completely
> read.
> How would I know which is the last read?
>
> A code snippet would be greatly appreciated.
> --
> View this message in context: http://old.nabble.com/Reassembling-data-in-multiple-calls-to-the-ProtocolFilter-tp30463495p30463495.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>