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

What should I write instead of isBound? #578

Closed
kindaro opened this issue May 11, 2024 · 4 comments
Closed

What should I write instead of isBound? #578

kindaro opened this issue May 11, 2024 · 4 comments
Assignees

Comments

@kindaro
Copy link

kindaro commented May 11, 2024

The package krpc is not building. One of the issues is that the function isActive:

https://github.com/pxqr/krpc/blob/5c54f6570a27e1509ddf048a91bd69c05052f2f1/src/Network/KRPC/Manager.hs#L195-L201

— Wants to call isBound but I see from the change log that it was deprecated in 2.7 and removed in 3.0, along with other stuff related to SocketStatus.

I did not find any migration guide or the reasoning behind it being removed.

Is there a standard way to fix the function isBound?

@kindaro
Copy link
Author

kindaro commented May 11, 2024

Otherwise, could you release an updated version 2 that can be built with GHC 9.4 or thereabout? The latest as of now is 2.8.0.1 and it needs base < 4.17 which is kinda close. Some versions of network-2 build with GHC 9.4 and the Cabal flag --allow-newer=base already so maybe it is only a matter of metadata revision.

@kazu-yamamoto
Copy link
Collaborator

Socket does not have the status anymore.

Probably you can check if a socket is bound using getSocketName.
The initial port is 0.
After binding, the port should be the server port.

When the socket is closed, the internal FD value becomes -1.
You can check it with withFdSocket.

@kindaro
Copy link
Author

kindaro commented May 14, 2024

Thank you, I shall try this.

@kazu-yamamoto
Copy link
Collaborator

Closing.
Please re-open if necessary.

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