LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ClientTCPWrite and timer issue

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

 

 

0 Kudos
Message 1 of 6
(3,801 Views)

The first thing I can think of is that if you put a 100 sec timeout ( Smiley Surprised ) 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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(3,799 Views)

0 Kudos
Message 3 of 6
(3,793 Views)

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)?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(3,775 Views)

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

 

0 Kudos
Message 5 of 6
(3,769 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(3,763 Views)