المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : TCP/IP Message Framing and Parsing [modified]



C++ Programming
08-26-2009, 02:32 PM
I want to send varying length application specific messages between my client and server application. The problem is how should I determine the length of message when receiving it?

I thought of one way was that I should append a termination string in the end of the message. But others said that prefixing the message length is far more better?

May I know why and how do I prefix it? Any code examples would be really appreciated. I'm using Winsocks (version 2.2, if that helps)

And, by the way, what is the minimum amount of bytes/bits that will successfully transfer in one shot using TCP/IP?

Thanks

Top Web Hosting Providers (http://www.webhostingyes.com/)[^ (http://www.webhostingyes.com/)]

Do, or do not. There is no 'try'.

modified on Wednesday, August 26, 2009 6:25 AM