LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ClientTCPread error handling

Hi -

 

As mentioned in other posts, I'm writing a small app using TCP. The twist is that the program has little knowledge about the incoming TCP messages -- it doesn't know how many it will get, or how long they will be, or when the server has stopped sending them.

 

My idea is to put the read into a loop (inside the TCP callback routine), and continue as long as the reads are successful. When the read finally times out, I'll interpret that as the end of incoming data and begin processing it. Not the cleanest solution, but all I can think of right now.

 

Issue: while I'm debugging, when the timeout occurs, I get a pop-up error informing me of the error. This is OK (though not particularly desirable) while I'm debugging, but it would be unacceptable if this happened in the production version of the code. So:

 

1. will this happen when the program is distributed, or is this just a feature of the debugger?

2. can I suppress it in the debugger? I don't really need this pop-up.

 

Thanks.

0 Kudos
Message 1 of 2
(2,770 Views)

The error popup can be suppressed in debug mode in two ways:

  • Unchecking Run >> Break On >> Library errors menu item: this disables popup errors for all libraries in the project which may be undesirable at least in the early stages of development
  • Using SetBreakOnLibraryErrors () function around TCP calls only: look at the help for the function for an explanation on how it works

At runtime you won't see the popup errors, but consider that severe errors could result in application crashes if not properly handled, so a good error checking strategy is crucial when coming to real applications.



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 2
(2,762 Views)