Re: Knowing if a client disconnected?

2008-08-17 Thread Patrick Logan
Paul J. Lucas paul at lucasmail.org writes: Suppose I have a service that takes some time to compute the response to. Further suppose that a client connects but then disconnects prematurely for whatever reason either before I start or while I am returning a response. Is there any way to

Re: Knowing if a client disconnected?

2008-08-14 Thread Marc Larue
aout 2008 20:57 A : discuss@restlet.tigris.org Objet : Re: Knowing if a client disconnected? On Aug 13, 2008, at 10:26 AM, Jerome Louvel wrote: The closest you'll find in the Restlet API is the org.restlet.service.ConnectorService class that has two callback methods: - beforeSend

Re: Knowing if a client disconnected?

2008-08-14 Thread Bruno Harbulot
Hi Marc, I think what Kevin meant (and was more along my interpretation of the original question) is that you can know that a socket has been closed before attempting to write to it, but you cannot know that it's going to be open for writing until you actually write to it. As Jerome pointed

Re: Knowing if a client disconnected?

2008-08-14 Thread Marc Larue
Hi Bruno, I think guaranteed delivery is what TCP was designed for and HTTP/1.1 reuses the TCP socket. You do not need to write something to a TCP socket to see if it is writeable, the socket throws an exception if it closes or becomes unwriteable. You will know if a client disconnected in

Re: Knowing if a client disconnected?

2008-08-14 Thread John D. Mitchell
On Thursday 2008.08.14, at 09:19 , Marc Larue wrote: [...] I'm sure that in theory everything is really complex, but in practice when the client disconnects the TCP socket a Socket closed IOException will be trown on the server. Sigh. With that kind of attitude, I'll say my final bit here

RE: Knowing if a client disconnected?

2008-08-13 Thread Jerome Louvel
:[EMAIL PROTECTED] Envoye : mercredi 13 aout 2008 06:11 A : discuss@restlet.tigris.org Objet : Knowing if a client disconnected? Suppose I have a service that takes some time to compute the response to. Further suppose that a client connects but then disconnects prematurely for whatever reason

Re: Knowing if a client disconnected?

2008-08-13 Thread Paul J. Lucas
On Aug 13, 2008, at 9:53 AM, Jerome Louvel wrote: If the socket is broken or was closed by the client while the response is written, you won't be able to restore it. However, you can log the fact the you got this request from this client and wait for the client to retry its request. OK,

Re: Knowing if a client disconnected?

2008-08-13 Thread John D. Mitchell
A : discuss@restlet.tigris.org Objet : Re: Knowing if a client disconnected? On Aug 13, 2008, at 9:53 AM, Jerome Louvel wrote: If the socket is broken or was closed by the client while the response is written, you won't be able to restore it. However, you can log the fact the you got this request from

Re: Knowing if a client disconnected?

2008-08-13 Thread Paul J. Lucas
On Aug 13, 2008, at 10:26 AM, Jerome Louvel wrote: The closest you'll find in the Restlet API is the org.restlet.service.ConnectorService class that has two callback methods: - beforeSend(Representation entity) - afterSend(Representation entity) Maybe we could introduce a new call-back

RE: Knowing if a client disconnected?

2008-08-13 Thread Jerome Louvel
~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Paul J. Lucas [mailto:[EMAIL PROTECTED] Envoye : mercredi 13 aout 2008 20:57 A : discuss@restlet.tigris.org Objet : Re: Knowing if a client disconnected? On Aug 13, 2008, at 10:26

Knowing if a client disconnected?

2008-08-12 Thread Paul J. Lucas
Suppose I have a service that takes some time to compute the response to. Further suppose that a client connects but then disconnects prematurely for whatever reason either before I start or while I am returning a response. Is there any way to know if the client is really still there