-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Socket type and family as CInt patterns
The current sum-type model for Socket types and families is not extensible, and makes it needlessly difficult to perform generic operations on sockets, see e.g. #427 This commit, simplifies the model by replacing the sum-types in question with newtypes around CInt + patterns for the known constant values. It also adds the SO_DOMAIN and SO_PROTOCOL options (when available on the target system). The "Read" instance for "Family" is for simplicify limited to just the address families actually supported by the library (unspec, inet, inet6 and unix). The rest could be added if deemed worth the trouble.
- Loading branch information
Showing
6 changed files
with
698 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.