Will writing a 4 byte array to a TCpClient networkstream fragment?
Simple question. Just hope I can ask it clearly.
As in the title, if I write a 4 byte array to a tcpclient network stream, could it be fragmented or because of TCP's packet size it will always arrive in one go?
I hope I asked that right.
Re: Will writing a 4 byte array to a TCpClient networkstream fragment?
It is possible (unlikely, perhaps) that it will get fragmented. There's a well known law that states if you don't take the possibility into account, it will happen when you least want / expect it. :)
Re: Will writing a 4 byte array to a TCpClient networkstream fragment?
Much appreciated.... I will handle the unlikely.
Re: Will writing a 4 byte array to a TCpClient networkstream fragment?
i don't know alot about that ,but form other tutorials i read , i found that :
if you send data like that
123456
then send
789
it may arrive in any of this ways :
123456789 (2 data are joined)
------------------------------
12
3456
789
(First data splitted to 2 data and second reach at once)
-------------------------------------------------------
1234567
89
(Part of second data is joined with first one and the reset reach in another packet )
so you need to handle this :)
i don't know if this right or not but it seem to as it happen in my application :(