Thread overview
[phobos] Status on std.socket and std.socketstream
Jun 12, 2011
David Nadlinger
Jun 12, 2011
Masahiro Nakagawa
Jun 12, 2011
David Nadlinger
June 12, 2011
What is the status on std.socket and std.socketstream? I see a few problems with std.socket. Here are some: it is not RAII, it uses obsolete functions, and it is not thread safe. What about socketstream? Does anyone use that thing? Is it even needed?

I am actually asking all these questions because I am thinking of working on this next. Is someone already working on this?

If we decide to replace std.socket what should be the procedure? I am thinking of probably deprecating std.socket and adding std.net.

Thanks,
-Jose
June 12, 2011
On 6/12/11 5:09 PM, Jose Armando Garcia wrote:
> What is the status on std.socket and std.socketstream? I see a few problems with std.socket. Here are some: it is not RAII, it uses obsolete functions, and it is not thread safe.

Its design is ? questionable, it doesn't support IPv6, it is one hell of a leaky abstraction (you still have to deal with the OS-specific error codes, not only the difference between errno on Posix and WSAGetLastError on Windows, but also different behavior on the Posixen, like in the use of ECONNRESET on peer shutdown).

> I am actually asking all these questions because I am thinking of working on this next. Is someone already working on this?

I'm not actively working on a std.socket replacement yet ? for now, I'm just patching the existing code for use in my GSoC project. I probably would have had a look at writing a replacement with IPv6 support, etc. later down the road, but I'd be glad if I didn't have to.

> If we decide to replace std.socket what should be the procedure? I am thinking of probably deprecating std.socket and adding std.net.

I can't really give an answer here ? I would personally go for std.net.socket, but it using std.net as second-level package officially blessed already?

David
June 13, 2011
Last year, I tried std.socket improvement(not finished).

http://lists.puremagic.com/pipermail/phobos/2010-July/001171.html http://lists.puremagic.com/pipermail/phobos/2010-September/002321.html

If you try replacement, you may implement event module or work cooperatively with other people (Probably Max and Jonas).

In the future, std.stream will be replaced with new stream module. I think current std.socketstream should be removed.

One question:
Socket itself is not networking part. std.net.socket is good place?


Masahiro

On Mon, 13 Jun 2011 00:09:06 +0900, Jose Armando Garcia <jsancio at gmail.com> wrote:

> What is the status on std.socket and std.socketstream? I see a few problems with std.socket. Here are some: it is not RAII, it uses obsolete functions, and it is not thread safe. What about socketstream? Does anyone use that thing? Is it even needed?
>
> I am actually asking all these questions because I am thinking of working on this next. Is someone already working on this?
>
> If we decide to replace std.socket what should be the procedure? I am thinking of probably deprecating std.socket and adding std.net.
>
> Thanks,
> -Jose
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
June 12, 2011
On 6/12/11 6:14 PM, Masahiro Nakagawa wrote:
> Last year, I tried std.socket improvement(not finished).
>
> http://lists.puremagic.com/pipermail/phobos/2010-July/001171.html http://lists.puremagic.com/pipermail/phobos/2010-September/002321.html
>
> If you try replacement, you may implement event module or work cooperatively with other people (Probably Max and Jonas).

If you are going to tackle evented network I/O, let me know as well, I'm going to need that for my GSoC project.

David
June 12, 2011
On Sun, Jun 12, 2011 at 1:18 PM, David Nadlinger <code at klickverbot.at> wrote:
> On 6/12/11 6:14 PM, Masahiro Nakagawa wrote:
>>
>> Last year, I tried std.socket improvement(not finished).
>>
>> http://lists.puremagic.com/pipermail/phobos/2010-July/001171.html http://lists.puremagic.com/pipermail/phobos/2010-September/002321.html
>>
>> If you try replacement, you may implement event module or work cooperatively with other people (Probably Max and Jonas).
>
> If you are going to tackle evented network I/O, let me know as well, I'm going to need that for my GSoC project.
>

I would like to do that but lets first resolve the std.socket problem. ;)