LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp/ip connection Dropped! (Urgent!!! Please)

I'm using LabWindows/CVI.

My Question is tcp/ip connection dropped problem between tcp server and tcp client.

TCP Server PC and Client PC is running on the same network.(Hook up at the same dummy HUB, just 2PCs)

The Program what I've tested is NI's Sample program located C:\CVI\SAMPLES\TCPSERV.EXE & TCPCLNT.EXE

I added timer in the client program for the purpose of sending system time and date every 100msec.

3 or 4 hours later, tcp connection losted. the error message is tcp read error(server PC screen) and tcp write error(client PC screen).

The O/S is Win98

Please help this problem.

Your Prompt solution would be appreciated.

Thank you.

-CH Lee-
0 Kudos
Message 1 of 2
(3,791 Views)
It sounds like you have modified the examples a tad more than you noted, but nonetheless here are some suggestions and things to think about:

1) How did you obtain the error messages that you say you received? Were you reading the "errCode" parameter of your callback function, or viewing the "status" return value of a call to one of the client/server read/write functions? If you only obtained the error info from a call to one of the read/write functions you will have to develop your own arbitration scheme that will try to resend/reread the message on both ends and develop a method to test the integrity of your data (whether or not it has been repeated or if something has been lost). If you obtained the error code by viewing the "errCode" parameter in your callback function look at the info in #2 below.

2) The best way to detect if a connection has been lost is to handle the TCP_DISCONNECT event inside of your callback functions, and inside of your event handling block put in a call to GetTCPErrorString or GetTCPSystemErrorString to see why the disconnect happened. GetTCPSystemErrorString will probably give you more information about the specifics of your network integrity, but you will have to make sure that the info returned is due only to this program and not another. So, even if you do determine the cause of the disconnect it may be unfixable and you really should develop a "stay up connection" scheme that allows your apps to reconnect upon this type of failure.

Note: Every time I say scheme, I mean this is code that you will have to write yourself, the TCP library does not do anything this application specific for you.

As far as why this is happening at all you will need to do further troubleshooting to see if maybe your connection is becoming overloaded in which GetTCPSystemErrorString might help you determine that, and you might want to check to see how much system resources this app is taking up with a good monitoring utility like TaskInfo2000 (freely available on the web, please do not use any Windows 9x native utilities they are useless).

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(3,790 Views)