Hi,
As some background, I have implemented a new stream object to work with
tcp socket streams. I derive a new socket stream from basic_streambuf.
I then derive a my sream object from my implemntation of basic_streambuf
and from basic_iostream.
I am then using the function getline. This works fine using '\n' or any
other character as the delimiter for getline().
eg.
TCPSockSteam mySockStream;
//send some request
....
//get thre response
std::string str;
geline(mySockStream, str, '\n');
However, the peer I am working with is a Macromedia Flash based XML
socket aplication. These terninate their messages with a closing '\0'
character, so it would be nice to use getline to read a line from the
beginning until a '\0' is reached (much the same as '\n' but with '\0')
However, when I try and use code as below:
geline(mySockStream, str, '\0');
the message is never recieved. My knowlege of the iostream libraries
internal mechanics is not great, so I guess what I'm asking is how they
deal with '\0' in the context of getline and streams. I'm guessing from
the above not the same as other non-null characters...
Any help is much appreciated.
Cheers
Chris