dev@grizzly.java.net

Re: need async http parser

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Tue, 11 Dec 2012 15:49:32 -0800

The Grizzly HTTP framework already does this - why not use it? Can you
go into details on what you're trying to accomplish? Also, what version
of Grizzly are you currently using?



> dean_at_xsoftware.biz <mailto:dean_at_xsoftware.biz>
> December 11, 2012 3:32 PM
> Is there re-usable code in grizzly that I can use for http parsing?
> ie. It would be great to feed in bytes like so and it returns null if
> there is not yet enough bytes
>
> private byte[] previousData;
>
> byte[] data = incomingMergedWithPrevious(previousData);
> HttpResponse resp = httpResponseParser.parse(data);
> if(resp == null) {
> return; //we do not have full data to parse yet
> }
>
> //otherwise fire the response to someone else.
>
> OR maybe I could re-use the code a different way. All I know is I get
> bytes that don't always have all the http headers yet since it is
> asynch stuff. Any way to parse stuff?
>
> thanks,
> Dean