Hi Minh,
Minh O wrote:
> 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)?
No you don't. The CometContext.notify() will take care of resuming and
suspending the connection again.Only when you want to resume the
connection (bring it backto a synchronous connection) that you need to
call resumeCometHandler(). So I suspect you shouldn't call it :-) and
let the 1 hour expiration happens....
Thanks
-- Jeanfrancois
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
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>