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

Report target host/port with connection exception #529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yaitskov
Copy link

No description provided.

connect s sa = withSocketsDo $ withSocketAddress sa $ \p_sa sz ->
connectLoop s p_sa (fromIntegral sz)
connectLoop (show sa) s p_sa (fromIntegral sz)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showed socket addr is lazy right? so no problem with that,
though I think SockAddr Show instance is doing too much and might fail due IO and hide original error.
I would fall back to generated Show and move current Show implementation to a new dedicated method of SocketAddress class. I don't know how much legacy would be affected by such refactoring.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to introduce the Strict pragma someday and don't want to relay on the lazy evaluation. So, what about just passing sa to connectLoop and connectLoop calls show by itself?

@kazu-yamamoto kazu-yamamoto self-requested a review May 30, 2022 05:27
@kazu-yamamoto
Copy link
Collaborator

@yaitskov If you would like to merge this PR, please resolve my comment above.

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

Successfully merging this pull request may close these issues.

2 participants