Error Handling


SmartSockets provides some simple error handling for its C API functions. The error handling system provides additional information about why a function call failed. This is most often found in functions that return a TRUE or FALSE status. For function calls that support error handling, the global SmartSockets error number is set to a value that provides additional information about why the function failed. This global error number, which is stored in a per-thread value for multi-threaded programs, can be retrieved with TutErrNumGet and set with TutErrNumSet. To simplify logging or printing notification of errors, a string describing the error can be retrieved with TutErrStrGet or TutErrNumToStr. The Diagnostics section of each function description describes how error handling is supported for that function. The error number should only be used immediately after a function which supports error handling returns a failure value. At any other time, the value of the error number is meaningless.

In the C++ class library, C++ member functions generally do not return a success status, but rather return the result of the corresponding operation. A status flag is maintained in the Tobj base class that can be checked either by using a unary ! operator or by calling the member function Tobj::Status. Access to the SmartSockets global error number through the TutErrNumGet and TutErrNumSet functions is left unchanged in the C++ class library.


TIBCO SmartSockets™ cxxipc Class Library
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com