[Issue 4025] Making network with the std.stdio.File interface

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 23 19:31:10 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=4025


Vladimir Panteleev <thecybershadow at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow at gmail.com


--- Comment #1 from Vladimir Panteleev <thecybershadow at gmail.com> 2011-08-23 19:31:06 PDT ---
Some thoughts:

* The concept is POSIX-only. Windows uses different APIs and handles for files
and network connections.
* I'm not sure why you used the C socket functions when you could have used
std.socket for the setup and obtained the handle. This could have shortened the
code considerably. (One drawback against using std.socket I can see is that its
destructor closes the socket, so you must maintain a reference to the Socket
object.)
* Perhaps std.stdio.File should just have public constructors which accept a
FILE* or (on POSIX) a file descriptor. This would eliminate the need for such
dedicated code, and instead provide better general support (for pipes and
whatever else file descriptors are used for).
* Alternatively, there's always std.socketstream...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list