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 the error code suffixes, see %SQLANY12%\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 A string with additional information, if available, for the stream_error_code. The string may or may not be empty. A non-empty error_string value provides information in addition to the stream_error_code value. For example, for a write error (error code 9) the error string is a number showing how many bytes it was trying to write.
UltraLite applications other than the UltraLite C++ Component receive communications error information as part of the Sync Result 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 %SQLANY12%\SDK\Include\sserror.h.
Check for a SQLE_MOBILINK_COMMUNICATIONS_ERROR:
ULConnection * conn; ul_sync_info info; ... conn->InitSynchInfo( &info ); if( !conn->Synchronize( &info ) ) { ULError const * error = conn->GetLastError(); char buf[256]; if( error->GetSQLCode() == SQLE_MOBILINK_COMMUNICATIONS_ERROR ) { error->GetString( buf, sizeof(buf) ); printf( "%s\n", buf ); // more handling for communication error } } |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |