title: C++ and network sockets
body: <p>I have dabbled in C, and I am currently picking up C++.</p>
  
  <p>I want to learn the standard library (<code>std::</code> namespace), so I am working on a few projects.  One is a simple email program that logs into my local SMTP server and shows my email, and has the ability to send mail.  I add a touch of ncurses for that old feel.</p>
  
  <p>The problem is, I haven't been able to find a standard library way to use network sockets.  It seems like I have to use network sockets in C <code>sys/socket.h</code>, but then I end up with a file descriptor, which leaves <code>read()</code> and <code>write()</code> and <code>send()</code> function calls.  I wanted to be able to use the <code>std::fstream</code> or <code>std::ostream</code> classes.  But the <code>open()</code> member functions take a filename, not a file descriptor.</p>
  
  <p>I know that the Boost library has this capability, but templates and such are way over my head, and I want to stick with just the standard library for now.</p>
  
  <p>Before I proceed, I just want to make sure that there isn't a better way to <code>read()</code> and <code>write()</code> to a file descriptor that's been returned by the <code>connect()</code> network socket C function.</p>