Provides a structure to hold communications error reporting information.
The syntax varies depending on the API you use.
This parameter applies only to C/C++ interfaces.
The parameter has no default value, and must be explicitly set using one of the supported fields. The ul_stream_error fields are as follows:
stream_error_code For a listing of error numbers, see MobiLink communication error messages. For the error code suffixes, see install-dir\SDK\Include\sserror.h.
system_error_code A system-specific error code. For more information about the error code, you must look at your platform documentation. For Windows platforms, this is the Microsoft Developer Network documentation.
The following are common system errors on Windows:
10048 (WSAADDRINUSE) Address already in use.
10053 (WSAECONNABORTED) Software caused connection abort.
10054 (WSAECONNRESET) The other side of the communication closed the socket.
10060 (WSAETIMEDOUT) Connection timed out.
10061 (WSAECONNREFUSED) Connection refused. Typically, this means that the MobiLink server is not running or is not listening on the specified port. See http://msdn2.microsoft.com/en-us/library/ms740668.aspx.
error_string An application-provided error message. The string may or may not be empty. A non-empty error_string provides information in addition to the stream_error_code. For instance, for a write error (error code 9) the error string is a number showing how many bytes it was trying to write.
error_string_length Deprecated. The size of the error string buffer.
UltraLite applications other than the UltraLite C++ Component receive communications error information as part of the Sync Result parameter. See Sync Result synchronization parameter.
The stream_error field is a structure of type ul_stream_error.
typedef struct { ss_error_code stream_error_code; asa_uint16 alignment; asa_int32 system_error_code; char error_string[UL_STREAM_ERROR_STRING_SIZE]; } ul_stream_error, * p_ul_stream_error; |
The structure is defined in install-dir\SDK\Include\sserror.h.
Check for SQLE_COMMUNICATIONS_ERROR:
Connection conn; ul_sync_info info; ... conn.InitSynchInfo( &info ); info.stream_error.error_string = error_buff; info.stream_error.error_string_length = sizeof( error_buff ); if( !conn.Synchronize( &synch_info ) ){ if( SQLCODE == SQLE_COMMUNICATIONS_ERROR ){ printf( error_buff ); // more error handling here |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |