users@grizzly.java.net

Re: comet help

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 18 Oct 2007 08:08:46 -0400

Hi Minh,

Minh O wrote:
> Hi Jeanfrancois,
>
> I think I figured out one of the problems. ExtJS framework for ajax request has a timeout. I noticed last night that after putting some logging statements in onInterrupt and on onTerminated, the onInterrupt method was being invoked after 20sec~ or so. I checked the documentation for Ext.Ajax.request and there is a default timeout of 30sec. Close to what I was experiencing so today I'll try setting the timeout to a large number and work out sending the json message to the client.
>

did you figure it out? I'm interested to learn if ExtJS can work with
Grizzly Comet properly.

> Thanks for the help. Once I get this done, I'd be more than happy to put up a tutorial on building a servlet and client side for the curious. Just let me know if there are any guidelines to that.
>

A tutorial kind of document like this one:

https://grizzly.dev.java.net/tutorials/connection-cache/index.html

would be quite appreciated if you have time, of course :-)

A+

-- Jeanfrancois



> Minh
>> Date: Tue, 16 Oct 2007 07:57:31 -0400
>> From: Jeanfrancois.Arcand_at_Sun.COM
>> To: users_at_grizzly.dev.java.net
>> Subject: Re: comet help
>>
>> 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
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>
> _________________________________________________________________
> Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now.
> http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>