in reply to Re^4: how to control segmented messages in TCP chat client
in thread how to control segmented messages in TCP chat client

thanos1983,

Take a look at this, especially the code that BrowserUk provides. This may help you understand the problem better. When reading from the socket you need first to know the size of the message. 'pack' with the 'N' parameter works great for this and then read the message. It requires 2 reads.

Regards...Ed

"Well done is better than well said." - Benjamin Franklin

  • Comment on Re^5: how to control segmented messages in TCP chat client