Am 20.10.2011 23:44, schrieb Daniel Gibson:
Am 20.10.2011 11:37, schrieb Steve Teale:
2) We don't have an off-the-shelf Socket class for Unix Sockets
It shouldn't be too hard to add AF_UNIX support to std.socket.
(Derive something suitable from std.socket.Address and possibly
std.socket.Socket)
In fact, I have some old untested code lying around that adds such an
Address type: http://pastebin.com/gMxd4AqB
It's from D1 though and /may/ need minor changes to work with the
current std.socket. (Also it may be buggy, as it's untested)
Ok, while having a quick look at this old code I spotted the following bugs:
1. Line 23: path[1] does not exist if path.length==1 => check length
2. After Line 29 should be a return (or else { ... } with ... being
lines 31-36)
Seems like I was tired or drunk or something when I wrote that ;)
Fixed (still untested) version: http://pastebin.com/Vb5QqJwS
(IPv6 support is also missing from std.socket btw)
Cheers,
- Daniel