Provide 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_id Not required. The value is always 0.
stream_context The basic network operation being performed, such as open, read, or write. For details, see sserror.h.
stream_error_code Not required. The value is always 0.
For a listing of error numbers, see MobiLink Communication Error Messages. For the error code suffixes, see 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 the Microsoft Developer Network web site.
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 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_a { ss_stream_id stream_id; ss_stream_context stream_context; ss_error_code stream_error_code; asa_uint32 system_error_code; char *error_string; asa_uint32 error_string_length; } ss_error_a, *p_ss_error_a;
The structure is defined in sserror.h, in the h subdirectory of your SQL Anywhere installation directory.
Check for SQLE_COMMUNICATIONS_ERROR as follows:
Connection conn; auto ul_synch_info_a 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 handline here