Hi,

I am not sure why my previous mail was not answered? I hope that i
will get the reply this time

So here is the same query again...
Was curious what event.setTimeOut(timeOutValue) means on a comet event.

1. Does it mean that the request will timeout after timeOutValue and the
server will close the connection and call the END event.

I am trying to establish a persistent connection for asynchronous message
delivery using comet.

I create a chunked request (using socket) send HTTP POST with content. Then
create thread which reads from the socket outputstream.

On the server side on a comet event for the POST request
1. I set the event timeout to timeOutValue
2. Create a new thread passing the request,response and event
3. The event method of CometProcessor returns.

Observations:
1. If there is no activity on the response object (i.e no data is sent) and
if the comet client does not send any chunked data to the sever for
timeOutValue + 1 an END event is called by the server.

2. To prevent the calling of END event in Observation 1. i send a chunked
data from the client for every inactive interval of (timeOutValue -1)
[Heartbeat kind of mechanism].
In this case every time i send a heartbeat, the event method on the server
is triggered and event.setTimeOut is called again.
This prevents the server from calling the END event of the request and my
asynch message delivery from the thread i created runs fine and no END event
is called

Now from observation 2 what i found is as below:
a. Every time event.setTimeout is called for the same http request (can be
done for a chunked request sending some chunked data) the request timeout
increases to
(number of time event.setTimeOut is called) * (timeOutValue)
I.e on consequetive calls to event.setTimeOut the timeout value is increased
to (newtimeOutValue =oldTimeOutValue + timeOutValue)

1. Is this a bug in Comet? Or is this the desired behaviour?
2. What is the exact role of event.setTimeOut in case of normal request and
in case of chunked request in which chunked data can be sent again and
again?
3. For the asynch message delivery using comet as mentioned above is it
required to refresh the connection after some inactive time,probably the
timeOutValue? If yes, how can we assure that the END event is never called
for this request, considering my applications lifetime for message delivery
is the lifetime of the server once the thread is started.

Thanks,
Animesh

Reply via email to