www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How mature is std.socket?

reply lurker <lurker mailinator.com> writes:
Given that large parts of Phobos are still in flux or planned for
replacement I'd like to ask, how mature is std.socket?

I'm thinking of writing a small server app and would like to know if
there are serious problems awaiting the uninitiated?

Thanks
Feb 14 2011
next sibling parent lurker <lurker mailinator.com> writes:
Also, I wouldn't mind a small example of a server using std.socket.

Thanks
Feb 14 2011
prev sibling next sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Monday, February 14, 2011 17:16:33 lurker wrote:
 Given that large parts of Phobos are still in flux or planned for
 replacement I'd like to ask, how mature is std.socket?
 
 I'm thinking of writing a small server app and would like to know if
 there are serious problems awaiting the uninitiated?
I've never used std.socket and don't really know how mature it is, but it looks like the author of that module made some improvements to it recently which haven't made it into Phobos yet: http://d.puremagic.com/issues/show_bug.cgi?id=5401 So, I suspect that other than that, very little work has been done on it recently, though I don't know how much work it needs, if any. Presumably, the updates in that enhancement request deal with the most pressing issues. Regardless, I'm unaware of any current issues for std.socket (nothing really stands out in the bugzilla from what I can see), and I'm unaware of any plans to replace it. A socket type doesn't seem like the sort of thing that would really need do be overhauled though. Presumably, it's pretty low level. Bug again, I haven't really used it or looked at it. Maybe someone else would know more. - Jonathan M Davis
Feb 14 2011
parent Daniel Gibson <metalcaedes gmail.com> writes:
Am 15.02.2011 02:36, schrieb Jonathan M Davis:
 On Monday, February 14, 2011 17:16:33 lurker wrote:
 Given that large parts of Phobos are still in flux or planned for
 replacement I'd like to ask, how mature is std.socket?

 I'm thinking of writing a small server app and would like to know if
 there are serious problems awaiting the uninitiated?
I've never used std.socket and don't really know how mature it is, but it looks like the author of that module made some improvements to it recently which haven't made it into Phobos yet: http://d.puremagic.com/issues/show_bug.cgi?id=5401 So, I suspect that other than that, very little work has been done on it recently, though I don't know how much work it needs, if any. Presumably, the updates in that enhancement request deal with the most pressing issues. Regardless, I'm unaware of any current issues for std.socket (nothing really stands out in the bugzilla from what I can see), and I'm unaware of any plans to replace it. A socket type doesn't seem like the sort of thing that would really need do be overhauled though. Presumably, it's pretty low level. Bug again, I haven't really used it or looked at it. Maybe someone else would know more. - Jonathan M Davis
When the new code is accepted std.socket should be really usable (it was usable before if you didn't want to do too fancy stuff like feeding your own socket_t into std.socket.Socket or deriving from the Socket class.. but this is fixed in the new code). Better support for IPv6 (an Internet6Address class or something like that) and local connections (AF_UNIX) would be nice, though. Cheers, - Daniel
Feb 14 2011
prev sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
There's a broken example for D2 in the samples folder. It uses D1
code, so it needs to be translated properly to D2. char[] -> string,
string.find -> algorithm.find (+ algo's find is different) and some
other tidbits.

I'll see if I can try to fix it.
Feb 14 2011
parent reply lurker <lurker mailinator.com> writes:
Are you talking about listener.d? I managed to compile it with the
latest DMD:

http://pastie.org/1565017
Feb 14 2011
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 2/15/11, lurker <lurker mailinator.com> wrote:
 Are you talking about listener.d? I managed to compile it with the
 latest DMD:

 http://pastie.org/1565017
You've fixed it from 2.051, right? The one released with 2.051 doesn't compile without modifications.
Feb 14 2011
parent lurker <lurker mailinator.com> writes:
Yes, 2.51:

Digital Mars D Compiler v2.051
Copyright (c) 1999-2010 by Digital Mars written by Walter Bright
Documentation: http://www.digitalmars.com/d/2.0/index.html
Usage:
...
Feb 15 2011