I’m using QNX Neutrino 2.0 and i’ve noticed if I send data calling send()
routine ttcpip manager sending to network two TCP frames. When I seek my
data in captured frame i see there is few last bytes into second TCP frame
but i’ve sent data calling only once routine send(). Can you explain how
it’s happen and how to prevent dividing data into separate packets?
Thanks in advance.
You have no control of what TCP does with your data It can be divided
into several packets, it is only guaranted that you will receive them in right
order (its streaming protocol). The best way is to pack the data in a struct
with length parameter at the beginning, and then at the receiver end collect
incoming chunks of data until length is reached.
email@example.com Experimental Department of Scientific
phone: (+48 12) 617-2883 Equipment and Automation
fax: (+48 12) 634-2205 30-059 Krakow, al.Mickiewicza 30, Poland