C
Chris
Hi,
I'm playing/developing a simple p2p file sharing client for an existing
protocol.
A 2 second description of the protocol is
Message Length = int, 4 bytes
Message Code = int, 4 bytes
Data
When creating messages is easy to use a std:stringstream and when
reading received messages, it easy to use a std::vector<char>.
I unclear as to which is more appropriate/efficient for the task and
was hoping some light could be shared on this, i have asked on irc
and been told 'it depends'. What does it depend on?
Thanks.
Chris
I'm playing/developing a simple p2p file sharing client for an existing
protocol.
A 2 second description of the protocol is
Message Length = int, 4 bytes
Message Code = int, 4 bytes
Data
When creating messages is easy to use a std:stringstream and when
reading received messages, it easy to use a std::vector<char>.
I unclear as to which is more appropriate/efficient for the task and
was hoping some light could be shared on this, i have asked on irc
and been told 'it depends'. What does it depend on?
Thanks.
Chris