Quote:
Originally posted by Agent007
Thank you both for your answers,
BUT my software will be developed under multiplatform (server side on windows and client side on unix/windows)
So bretzeltux, will your method still work if i develop the server program under windows ???
and luxitan, what is pragma ?? and what does it do ???? [/B]
|
I have found
this interresting study case about your problem. I think it will answer most of your ( and my ) questions
But one problem like the one I have described in my previous message is that TCP/IP protocol is a reliable transport over internet but the bottom line is that it is a
STREAMed protocole. That means that all the data is warranty to be delivered but NOT in one shot.. Several read calls may be required to receive the whole data block.
i.e:
server sends:
send(sockfd, (char*)&data, sizeof(data));
client receive:
somebytes += read(sockfd, (char*)&data, sizeof(data));
somebytes += read(sockfd, (char*)&data, sizeof(data));
somebytes += read(sockfd, (char*)&data, sizeof(data));...etc...
until the sum of somebytes equals the sizeof data struct...
again hoping it helps you better
Bretzel