On Tuesday 09 February 2010 07:11:40 you wrote:
> Hi,
> I am Using a Socket client to send a http request to sever and then waits
> to read response from the socket inputstream..
>
> 1. I have a comet servlet. On its read event it starts a new thread passing
> the request and response object.
>
> 2.The read event code block then returns.
> 3. The thread started in the read event starts writing the responses in the
> response stream.
> PrintWriter writer =response.getWriter();
> writer.write("asynresponse");
>
> 4. after writing say 5 responses i want to just close the request and
> response (not the socket which sent the request)
> Sending header Connection:close closes the Socket
>
> How do i do this?
>
> Since i cannot trigger the Comet servlet END event explicitly, where/how
> can I call event.close();
>
> I tried passing the event object from the read event to the thread and
> called event.close in the thread. But an exception was
> thrown saying event object is no longer associated with the request and
> response.
>
> Thanks,
> Animesh
Why are you starting a new thread instead of writing the response and calling
event.close() from the thread in which event(CometEvent) is called?
> P.S: BTW Kudos to the forum. Is is so alive. have been sending queries
> since some days and got replies.
> Also just to let u know i have a business problem where a http request and
> response are to be served using comet asyncronously on the same socket
> connection.
>
> So i have a single socket client which wants to send http request again and
> again (pipeline) and waits for a asyn response from the comet server.
> trying a POC for the same.
> Any ideas for concrete pipelining clients would be greatly appreciated.
>
> Thanks,
> Animesh
>
--
Stephen Byrne
[email protected]
(585) 286-5817
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]