[Twisted-Python] Perspective Broker example broken
![](https://secure.gravatar.com/avatar/d3ca94051c474bf2a108e5af0a12544e.jpg?s=120&d=mm&r=g)
Hi, I'm trying to get the Authentication with Perspective Broker examples to work, and I'm getting a Failure: http://twistedmatrix.com/projects/core/documentation/howto/listings/pb/chats... http://twistedmatrix.com/projects/core/documentation/howto/listings/pb/chatc... The server returns this error when you run the client: Unhandled error in Deferred: Traceback (most recent call last): Failure: twisted.spread.pb.PBConnectionLost: [Failure instance: Traceback (failure with no frames): twisted.internet.error.ConnectionDone: Connection was closed cleanly. ] What does this mean? It doesn't occur if I don't call reactor.stop() from the client. Is there some other cleanup I have to do when shutting down the reactor from the client side? Peter __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
![](https://secure.gravatar.com/avatar/7ed9784cbb1ba1ef75454034b3a8e6a1.jpg?s=120&d=mm&r=g)
On Sun, 29 Jan 2006 15:51:25 -0800 (PST), Peter Stradinger <emlprime@yahoo.com> wrote:
PB was doing something, and had possibly exposed a Deferred to application-level code, but suddenly the connection was lost, before a result with which to fire that Deferred could be constructed from bytes received from the network.
Most likely, the server's send() call has not had a chance to complete fully when the client decided to exit. This prevents the client from sending its reply to the send() call. The server reports exactly what happened. You can avoid this by only disconnecting (ie, stopping the reactor) when receiving a response to a call (as opposed to doing so when you receive a call but before you respond), although this can be difficult if you have more than one thing happening at a time. More likely, you just want to handle PBConnectionLost on the server. In many cases, it is probably appropriate just to trap and ignore it. Jean-Paul
![](https://secure.gravatar.com/avatar/7ed9784cbb1ba1ef75454034b3a8e6a1.jpg?s=120&d=mm&r=g)
On Sun, 29 Jan 2006 15:51:25 -0800 (PST), Peter Stradinger <emlprime@yahoo.com> wrote:
PB was doing something, and had possibly exposed a Deferred to application-level code, but suddenly the connection was lost, before a result with which to fire that Deferred could be constructed from bytes received from the network.
Most likely, the server's send() call has not had a chance to complete fully when the client decided to exit. This prevents the client from sending its reply to the send() call. The server reports exactly what happened. You can avoid this by only disconnecting (ie, stopping the reactor) when receiving a response to a call (as opposed to doing so when you receive a call but before you respond), although this can be difficult if you have more than one thing happening at a time. More likely, you just want to handle PBConnectionLost on the server. In many cases, it is probably appropriate just to trap and ignore it. Jean-Paul
participants (2)
-
Jean-Paul Calderone
-
Peter Stradinger