|
-
Aug 24th, 2011, 08:03 PM
#1
Thread Starter
Addicted Member
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.
-
Aug 25th, 2011, 02:02 AM
#2
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.
-
Aug 25th, 2011, 08:09 PM
#3
Thread Starter
Addicted Member
Re: Will writing a 4 byte array to a TCpClient networkstream fragment?
Much appreciated.... I will handle the unlikely.
-
Sep 22nd, 2011, 02:45 PM
#4
Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|