Closed dcordb closed 3 years ago
Hi!
This is a safeguard to avoid corrupt transfers for the next method call, because the keyboardinterrupt could come halfway through reading bytes from the socket. If the connection wasn't reset, there's a chance the next call would read remaining bytes in the socket's IO buffer as being (part of) the response for this next method call - which leads to further trouble.
See the comment in the code block starting at https://github.com/irmen/Pyro5/blob/e76080fad180672efb24569606483cc90e3c3370/Pyro5/client.py#L246
Thanks for this amazing library.
I have the following code on the server:
And on the client:
I run this, and then type ctrl-c on the call of
srv.foo()
(on the client). The output on the client is:The question is, why does the proxy loses the connection when the KeyboardInterrupt exception happens?