Hello
I would like to ask for consideration of some new functionality for
boost::serialization.
If I have a stream and I do not want to close the stream at the end of
serialization I have to make easy, but nasty trick using stringstream as a
buffer between my stream and serialized stream.
More concrete example. I'am using easy library for sockets. Connection is
represented as stream and after connection I do not want to close it. So when
I try to use serialization though the socket, serialisation is hanging - it is
waiting for the end of the stream, but there is no end of stream because it is
socket.
It will be useful just to add to library one fuction for manual sending data -
"simulation" of the end of stream. To avoid or closing socket either using
stringstreams buffers.
Below is example code for this problem - this code is using buffers, but IMHO
better will be that inside library will be functionality for such a
situation.
Best regards, Seweryn Habdank-Wojewódzki.
Ps. Full code I can send if will be needed.
void do_server()
{
string message("Hello Socket!\nHelloWorld!");
// create class instance
const gps_position g(35, 59, 24.567f);
try
{
TCPSocketWrapper sockserver;
// listen on some port
sockserver.listen(IPportnumber);
cout << "server is ready" << endl;
// accept connection from client
TCPSocketWrapper sock(sockserver.accept());
cout << "accepted connection from: "
<< sock.address() << endl;
// make the stream around the socket wrapper
TCPStream stream(sock);
bool oncemore = true;
int command;
while (oncemore)
{
// read the command
stream >> command;
switch (command)
{
case 1:
{
cout << "command 1" <