The following changes have been made to std.socket:
- License changed to Boost Software License - Version 1.0
- public constructor added for Socket that accepts an existing socket_t and its AddressFamily.
- createAddress protected method added to Socket, returns a new Address object for the current address family; can be overridden to support other addresses.
- Address class methods name and nameLen are now public.
- Remove std.traits Select!, use ptrdiff_t instead.
- Updated unittests; they were marked as broken and acted in various ways, but really they depend on the environment and network.
These changes were inspired by this thread: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=115983
Also updated htmlget.d sample to compile with the latest D2.
Thanks to those who have made various changes and fixes to std.socket since my last contribution.
The code can be found at the following URL (due to bugzilla's "original material" agreement).
http://www.dprogramming.com/socket14.zip
Comment #1 by andrei — 2011-01-03T08:52:27Z
Thanks, Chris! Since you went through the trouble of doing the actual work, any chance you could pass it through a formal review process modeled after http://www.boost.org/community/reviews.html? What you mainly have to do is enhance the documentation, generate HTML so people can see it, and act on feedback from people on the digitalmars.d newsgroup. Let us know - thanks!
Comment #2 by bugzilla — 2011-01-03T12:17:59Z
I also want to specifically thank Chris for changing the license to Boost.
Comment #3 by metalcaedes — 2011-02-14T23:42:04Z
This is great, thanks!
When this code is accepted http://d.puremagic.com/issues/show_bug.cgi?id=4234 can be closed.
If additional work is done for a review process etc, may I suggest to add support for IPv6 (Internet6Address?) and local addresses (AF_UNIX) as well (also a function like socketpair() would go nice with that)?
Comment #4 by johannespfau — 2011-02-15T09:41:02Z
Another small request: Could we use gethostbyname_r instead of gethostbyname where supported? This seems to be a lot safer regarding multithreading. gethostbyname_r seems to be a gnu extension, but it's a better option for all systems with the gnu c library. Or probably the getaddrinfo(3), getnameinfo(3), gai_strerror(3) functions could be used. Those are standard and also threadsafe.
Comment #6 by dlang-bugzilla — 2011-08-23T22:08:08Z
*** Issue 4234 has been marked as a duplicate of this issue. ***
Comment #7 by dlang-bugzilla — 2011-08-23T23:41:01Z
(In reply to comment #1)
> formal review process
I think that's overkill, considering there are nearly no API changes and it doesn't break existing code, but maybe the intent escapes me at the moment.
I've included Chris's update as part of a larger pull request containing various std.socket changes:
https://github.com/D-Programming-Language/phobos/pull/211
Comment #8 by beatgammit — 2013-05-19T22:47:38Z
This appears to be resolved. The associated pull request has been merged 2 years ago.