Reputation: 415
Sir, I am sending some string using TCP socket to another system. I have taken 8 buttons. On click of each button a different string is sent to the same IP and PORT using same socket. Socket is connected to specified IP once at the starting. Now in the second system in am analysing the packet(using some packet analyzer), but i could not find data properly. Problem:If i click one button and analyse the packet the its fine. i found packet and data part seperately. its quit fine. BUt if i click 3 or 4 buttons and after that analyse the packet in packet analyser than i found all the strings(from clicked buttons) connected under data part while there is only one header part. There must be different packets for different clicks. i mean each string must be encapsulated in different packet. What can be the problem? Please reply... Thank you.....
Upvotes: 0
Views: 199
Reputation: 15483
No, tcp is a stream protocol. You put data in in chunks at one end, but the boundaries between these chunks are likely to disappear when the data arrives at the remote end.
If you must use tcp, then you will have several choices.
BTW, you probably need to ensure there is only one writing thread per socket.
Upvotes: 2