22 May
2007
22 May
'07
5:17 a.m.
bringiton bringiton wrote:
Are there any solutions to this? ie building messages as they come in through the TCP stream.
Parse data from a socket stream the same way you'd parse data from any other sort of stream, such as a file. That is, design the protocol such that end-points can parse the message using its own contents, rather than meta-data such as 'messages.' Possibilities: 1) Use delimiters. A. Use text and use CRLF for a delimiter. B. Use a special octet as a delimiter, such as the null character. 2) Use message content-length