If you read tcp messages like files it would work properly on local but it may not work properly with other situations. So that you should reassamble the your tcp package on client side. Here is a great article on that problem.
As a summary there are three cases:
First case, you can assume that you read perfect amount of data.
Second case, you might not read data enough.
Third case, you might read more than one message.
So, according to these cases you should examine these situations. If you read perfect amount there is no problem. If you don't read enough you should wait for the next message and merge it appropriate amount. If you read more than one message you should hold the overflow into some variable and merge it with next income packet.
Hiç yorum yok:
Yorum Gönder