in reply to
Increase IO buffer
Use something similar to
chunked transfer encoding
which would allow you to detect the end-of-message easyly (it is marked by a 0-length chunk).
Comment on
Re: Increase IO buffer
In Section
Seekers of Perl Wisdom