05-24-2016 01:41 AM
i = ClientTCPWrite (gConversationHandle, sDataPtr, 602, 100000);
I used timer 10 sec, evry 10 sec im sending data to server but its not working only one time i will get data in server side next time im not recieving any data in server side....this thing i impelmented in sample program tcp its working fine there but in my pjt not working ,Plese i need your Help
thank you
05-24-2016 02:02 AM
The first thing I can think of is that if you put a 100 sec timeout ( ) you are not likely to satisfy you 10 sec timer if any problem occurr on the TCP side.
You should carefully trim the timeout based on the expected response time of your server, which is normally very short. If your server can really have a 100 sec timeout you should rethink your app implementing some sort of interlocking mechanism so that a write/read can occurr only if and when the preceding operation has succesfully terminated.
05-24-2016 03:31 AM
Hi Robert i trie same thing now my timer is 20 sec, 10 sect time out still not working
05-25-2016 02:15 AM
It is hard to judge what is happening with so few code and informations about your scenario. Are you sure no disconnect event has been received from the server in the meanwhile? Is the receive function short (i.d. could it be already processing old data while you try to get new one)?
05-25-2016 06:26 AM
Hi RobertoBozzolo,
i solved that problem i have one more doubt in ServerTCPRead in server side and ClientTCPWrite in client side
in Cleint Side i will send 100000 bytes two times below my code
1.) ClientTCPWrite (gConversationHandle, sDataPtr, 100000, 100); //First data
2.) ClientTCPWrite (gConversationHandle, sDataPtr, 100000, 100); // Second Data
in server side i will get get First data this fasion my ServerTCPReads three times for collecting first 100000 bytes =26264+45024+28712
second time directly i got 100000 bytes data from single ServerTCPRead.....
this criteria is coming huh in TCP/IP
first time ServerTCPReads will recive 50000 bytes
second time ServerTCPReads will recieve 70000 bytes
50000+70000=12000 bytes
pls help me sory for my poor grammr
05-25-2016 08:41 AM
As you can see in the help, ClienTCPWrite can not be able to send all data in a single pass. The help page shows how to address this problem. The larger the data size, the more probale this probelm will arise. On the server side, even ServerTCPRead may not be able to read all data from the queue in one pass.
That is, you need to tri your software according to the suggestions in the help to be sure all data is trasnferred via TCP.