On 01/23/2012 08:46 AM, Hanusz L. wrote:
> Hi,
>
> I'm using the pull method to send events to clients (with xmlrpc over ssl).
> The events are in a queue and when a client calls my 'get_event' xmlrpc 
> function; I get one event from the queue and send it to the client.
>
> The problem is that I want to be sure that the client receives all the events.
>
> Is it correct to assume that:
> IF the method connectionLost of my protocol (the wrapped protocol of the ssl 
> protocol) is called with a failure(error.ConnectionDone())
> THEN the connection was completed successfully and the client received the 
> event correctly ?
No, that just means the SSL disconnect and then  the TCP disconnect 
handshakes were done cleanly. That may happen for reasons other than 
queue being cleared, e.g. the server decided to shutdown for some reason.

You need to have some other way of knowing if queue is empty, e.g. way 
to query queue size (and knowledge that no one else will add to queue 
after you queried it).

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to