users@grizzly.java.net

RE: comet help

From: Minh O <minh13_o_at_hotmail.com>
Date: Tue, 16 Oct 2007 04:04:43 +0000

Hi Jeanfrancois,

If I understand correctly, when you add a handler, it suspends the thread. When I want to send a message back to the client, I need to resume the handler by calline resumCometHandler(this)? If this is the case, then I must call it before writing anything to the stream?. Will that keep the http connection alive from the server to the client?

I set the expiration time to be 1hr if that makes a difference.

Thanks for replying so late. I'll be cracking at it tonight and let you know how I fair tomorrow...fingers crossed.

Thanks,
Minh


> Date: Mon, 15 Oct 2007 20:59:11 -0400
> From: Jeanfrancois.Arcand_at_Sun.COM
> Subject: Re: comet help
> To: minh13_o_at_hotmail.com
> CC: users_at_grizzly.dev.java.net
>
> Hi Minh,
>
> Minh O wrote:
>> So I thought that might be the case in that regards but the hashcode is correct because I print the hashcode on handler add and the hashcode on message send and they both match up. I'll do more testing tonight to see if I made a mistake because that is a likely candidate so hopefully I find something tonight.Also, do I need the "event.getCometContext().resumeCometHandler(this);"
>
>
> You only need to invoke the resumeCometHandler if you want to resume the
> suspended connection. That might be the problem then...usually, you
> suspend the connection by calling addCometHandler(), and resume it using
> resumeComentHandler(). Do you need to resume it or can it be expired by
> Grizzly itself using the CometContent.setExpirationDelay() value?
>
>
> in the handler because from looking at the code it removes it from the
> map?ThanksMinh>
>
> Yes you are right. So you probably don't want to call it :-)
>
> Thanks
>
> -- Jeanfrancois

_________________________________________________________________
Help yourself to FREE treats served up daily at the Messenger Café. Stop by today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline