-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset the ProtocolBuffer transport socket upon a connection error #42
Conversation
Based on comments here, it might just be |
Yeah, leaving the except open is pretty ugly but my thought was that socket.connect is so low-level and simple that if anything raises anything I sort of want to reset the socket. I can change it, but I'm pretty sure nothing else could raise here that would make me want to not reset the socket. |
I think if the socket should be reset on "anything going wrong", then it should be I know this might seem pedantic, but do you have any reason to believe the state of the socket will be left invalid on anything but |
When I see Is MemoryError the only example? It is a little too pedantic to me. :) As a matter of fact, if All that said, I'm not afraid of MemoryError, I don't mind only catching |
I see people use both of them wrong all the time. There is a difference between them, take a look at the hierarchy here. So, for example, if the program received |
Fair enough, I guess I'm really not worried about what happens when someone decides to Also, I'm not sure which you're voting for now,
So... which is it. :) |
Apologies for the runaround. I vote |
Fixed the |
Looks good to me :) |
Reset the ProtocolBuffer transport socket upon a connection error or broken pipe.
Related to #38
This ensures that a PB client object is not forever wedged after an attempt to connect fails, or after an existing connection is severed.