Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can i catch a runtime error in ansi C90
    primarykey
    data
    text
    <p>I am using the library Function <a href="http://zone.ni.com/reference/en-XX/help/370051H-01/cvi/cviconnecttotcpserver/" rel="nofollow">ConnectToTCPServer</a>. This function times out when the host is not reachable. In that case the application crashes with the following error: "NON-FATAL RUN-TIME ERROR: "MyClient.c", line 93, col 15, thread id 0x000017F0: Library function error (return value == -11 [0xfffffff5]). Timeout error"</p> <p>The <a href="http://zone.ni.com/reference/en-XX/help/370051H-01/cvi/cvitcp_library_error_conditions/" rel="nofollow">Errorcode</a> 11 is a Timeout error, so this could happen quite often in my application - however the application crashes - i would like to catch this error rather than having my application crash.</p> <p>How can i catch this runtime error in Ansi C90?</p> <p>EDIT: Here is a Codesnippet of the current use:</p> <pre><code>ConnectToTCPServer(&amp;srvHandle, srvPort, srvName, HPMClientCb, answer, timeout); </code></pre> <p>with</p> <pre><code>int HPMClientCb(UINT handle, int xType, int errCode, void *transData){ printf("This was never printed\n"); return errCode; } </code></pre> <p>The Callbackfunction is never called. My Server is not running, so ConnectToTCPServer will timeout. I would suspect that the callback is called - but it never is called.</p> <p>EDIT 2: The Callback function is actually not called, the Returnvalue of <a href="http://zone.ni.com/reference/en-XX/help/370051H-01/cvi/cviconnecttotcpserver/" rel="nofollow">ConnectToTCPServer</a> contains the same error information. I think it might be a bug that <a href="http://zone.ni.com/reference/en-XX/help/370051H-01/cvi/cviconnecttotcpserver/" rel="nofollow">ConnectToTCPServer</a> throws this error. I just need to catch it and bin it in C90. Any Ideas?</p> <p>EDIT 3: I tested the Callbackfunction, on the rare occaision that my server is online the callback function is actually called - this does not help though because the callback is not called when an error occurs.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload