Boost logo

Boost Users :

From: Seweryn Habdank-Wojewódzki (habdank_at_[hidden])
Date: 2006-01-28 13:05:41


Hi

Robert Ramey wrote:

>> The following works fine. This is just a small suggestion. IMHO it is
>> very nice if I can serialize object (as binary, text or xml) through
>> the socket, isn't it?
>
> This is indeed an important application. But the serialization library
> is not the place to implement it !!! The serialization library
> depends upon the underlying streambuf (member of ?stream)
> to implement any actual i/o - it is here that the connection
> to sockets or special buffering should be made. In short
>
> ?socket_ostream os("name of socket, pipe or whatever")"
>
> {
> xml_archive oa(os);
> for(;;){
> oa << ....;
> os.flush(); // send object to socket
> }
> }

Ok, I understand it. It is good solution, thanks.

> Look in to makeing a custom stream buffer for your purposes.
> Investigate the iostreams library for this purpose.

Ok.

Best regards.

-- 
|\/\/|   Seweryn Habdank-Wojewódzki
`\/\/   

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