-
Notifications
You must be signed in to change notification settings - Fork 24
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
Enable socket options #9
Comments
That makes sense to me. For completeness, another option would be to have a single
or so. I'd be tempted to prefer that if it would allow libc to pass option through without looking at them, however a variant would still require libc to look at the opcode and construct the appropriate variant value. If libc is doing that, it isn't any extra work for it to just call a dedicated function like |
I've thought about adding socket options too. I just don't know what the most pragmatic way forward is yet. In general, it feels like that, after the initial BSD sockets interface design was defined 40 years ago, every new functionality was dumped behind a socket option. So it is not quite as simple as adding "just" 2 functions ( I don't see any benefits to having a single An other aspect is deciding which socket options will make it into the MVP, and which don't. I'd like to prevent the MVP growing in scope forever because of everybody requesting their own favorite options to be added. A while ago I did an inventory of all socket options. Below is a summary of what I think are the most common options: Not needed
Can already be derived from No problems
I have no objections to adding these. Timeouts:
The component-model will have built-in cancellation for every async operation, not just Dual stack
See: #1 Affecting other sockets on the system
It's not clear to me what the security and/or sandboxing implications of these options are. Multicast
Feels a bit much for the MVP. |
I agree, having separate functions for the options sounds like the most practical approach, and fits well with WASI. I also think your inventory here looks good. It's relatively easy to add or remove individual options as the proposal progresses, and the inventory here looks like a good starting point. |
Thanks for sharing the list, I think that looks good.
How about we start with a few properties as part of the MVP (e.g. |
I've created a PR with a handful of socket options: #13 For as far as a pattern exists, I used Rust's naming convention:
|
I'm going to close this. If more socket options are desired, those could be discussed in dedicated issues. |
In POSIX we have setsockopt/getsockopt which allow setting various parameters of the socket. I don't think we want to expose all of them through the API, but there's at least few of them that I think is worth exposing (for example,
SO_RCVTIMEO
/SO_SNDTIMEO). Because option values can have different type, I don't think it'd be feasible to define a generic
set_option/
get_option` method. Instead, we might end-up in having property functions, e.g.:what are your thoughts on that?
The text was updated successfully, but these errors were encountered: