TutErrNumGet get the value of the global SmartSockets error number
None
The value of the global SmartSockets error number.
None
The global SmartSockets error number is similar to the C-style error number errno
. A function that returns a failure status (FALSE
or NULL
) often needs to provide more information to you when an error occurs. This additional error information can be accessed using TutErrNumGet.
This error number is stored in a per-thread value to accommodate multi-threaded programs.
Not all functions set the global SmartSockets error number. Therefore, TutErrNumGet may return a value that is unrelated to the previous function call. The error number can be reset using TutErrNumSet(0)
before calling a function that may set the error number.
If the error number is set more than once in a function, TutErrNumGet returns only the last value set.
TutErrNumGetC, TutErrNumGetOs, TutErrNumGetSocket, TutErrNumSet, TutErrStrGet
This example prints the global SmartSockets error number and error string if a function fails:
if (TipcMsgGetPriority(msg, &priority) == FALSE) { TutOut("TipcMsgGetPriority failed: error %d <%s>.\n", TutErrNumGet(), TutErrStrGet()); }
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |