I'm using perl to write a socket based application. I found that if the client iniate two print on the socket handle in a way as below:
print $sock "hello kitty";
#do some other stuff
print $sock "hello jack";
the server side can't receive the whole message of "hello kitty". I'm not sure, but strongly suspicious that there are buffer overwrite happend somewhere... so I have two questiones here
- why the data is lost? is it because "print" has a limited size of buf?
- how to avoid it? I can accept other method other than the print way