Skip to content
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

Catch connection errors #10

Open
majek opened this issue Feb 10, 2012 · 2 comments
Open

Catch connection errors #10

majek opened this issue Feb 10, 2012 · 2 comments

Comments

@majek
Copy link
Owner

majek commented Feb 10, 2012

This looks quite bad:

Traceback (most recent call last):
  File "./stress_amqp.py", line 104, in <module>
    main()
  File "./stress_amqp.py", line 96, in main
    client.loop(timeout=1.0)
  File "../puka/connection.py", line 247, in loop
    self.on_read()
  File "../puka/connection.py", line 67, in on_read
    r = self.sd.recv(131072)
socket.error: [Errno 104] Connection reset by peer
@jmptbl
Copy link
Contributor

jmptbl commented Jun 12, 2015

I'm also unhappy with the current state of puka's socket error handling, but I'm not sure how to make it better. As the project founder, do you have any preference for how puka informs the app of socket exceptions? Should it throw exceptions from the wait() and handle_any_callbacks() functions? Or if being used with callbacks should it run the callback with a specially crafted result parameter? Any other ideas?

Just curious. :)

@majek
Copy link
Owner Author

majek commented Jun 13, 2015

The "wait" after connect should block until all IP's on all protocols (v4 v6) are tried out and failed. When it fails it should throw an exception, socket.error is fine.

It's just non-trivial to implement correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants