-
Notifications
You must be signed in to change notification settings - Fork 186
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
Reduce API variability due to system configuration #53
Conversation
Now all constructors of SocketOption, Family, and SocketType will always be declared, but using ones not supported on your system will lead to runtime errors. To guard against these, new functions isSupportedFamily etc. are introduced. As a side effect, DummySocketOption__ goes away, so this is strictly speaking a major API revision. This partially, but not completely, addresses issue #40.
- Replace several error-exceptions with IO exceptions - Add docs to SocketOption, getSocketOption, setSocketOption - Mention isSupportedFamily in Family docs - Insulate properly against socket option levels being undefined - Remove export of packSocketType, intended for internal use but not actually used
I hope the two commits I just added address your comments. Worth mentioning: since I was switching Probably the other "private" exports ought to be moved to an internal module. |
Hmm. Seems we already assume that SOL_SOCKET exists, and provide the sOL_SOCKET constant. I'm not sure why. Should I remove the tests for SOL_SOCKET (it almost certainly does exist if setsockopt does, I'd've thought) and/or remove the export of sOL_SOCKET? |
I've merged a rebased version of these commits (had to fix an indentation error in a case statement that caused a compile error). I decided to keep These changes were pushed the develop branch, which will be the next major release. |
Okay, great, thanks. (although the fact that you rebased them means that you kind of ended up committing code (even if only whitespace changes) under my name that I didn't write, and also means that the commits that exist in my repository are different from the ones in yours; couldn't you have done a merge instead?) |
I can't merge code that doesn't compile as that will e.g. break future git On Sat, Sep 8, 2012 at 1:08 PM, Ben Millwood notifications@github.comwrote:
|
Okay, fair enough. I'd've been happy to go and fix the bit that didn't compile, though. |
I'll let you do that next time. People's preferences differ in this area. On Sat, Sep 8, 2012 at 4:11 PM, Ben Millwood notifications@github.comwrote:
|
Now all constructors of SocketOption, Family, and SocketType will always
be declared, but using ones not supported on your system will lead to
runtime errors. To guard against these, new functions isSupportedFamily
etc. are introduced.
As a side effect, DummySocketOption__ goes away, so this is strictly
speaking a major API revision.
This partially, but not completely, addresses issue #40.