Boost logo

Boost Users :

Subject: [Boost-users] How can I create a ip::tcp::iostream from a SOCKET descriptor?
From: Eric J. Holtman (eric_at_[hidden])
Date: 2009-12-21 11:36:16


I'm trying to convert my hand-rolled marshalling code into
boost::serialization and boost::ip classes.

My code gets handed a SOCKET handle (win XP). I
have no control over this, the connection/server/client
stuff is handled elsewhere, I just get the SOCKET after
everything's already open.

How can I create an iostream from that, so I can then
use the Archive classes to send and receive objects
over the socket? I understand the "harder" stuff (writing
the overloads for my classes for input/output to a
generic stream).

I'm just stuck on finding that construction (or function)
that will take an already opened SOCKET handle
and wrap an iostream around it.

any clues?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net