void vortex_sasl_start_auth_sync ( VortexConnection connection,
const char *  profile,
VortexStatus status,
char **  status_message 
)

Perform SASL negotiation in a synchronous mode (blocking the caller until process finish).

This function does the same like vortex_sasl_start_auth but in a blocking manner. Check documentation this this function at vortex_sasl_start_auth.

Here is an example:

1 // some variable declaration for SASL status
2 VortexStatus status;
3 char * status_message;
4 
5 // set required properties
6 vortex_sasl_set_propertie (connection, VORTEX_SASL_AUTH_ID,
7  "bob", NULL);
8 vortex_sasl_set_propertie (connection, VORTEX_SASL_PASSWORD,
9  "secret", NULL);
10 
11 // begin SASL negotiation
12 vortex_sasl_start_auth_sync (connection, VORTEX_SASL_CRAM_MD5,
13  &status, &status_message);
14 // write out error
15 switch (status) {
16 case VortexOk:
17  printf ("OK: message reported: %s\n", status_message);
18  break;
19 case VortexError:
20  printf ("FAIL: message reported: %s\n", status_message);
21  break;
22 }

See Using SASL at client side for a detailed explanation about SASL support inside Vortex for the client side.

Parameters
connectionThe connection where the SASL negotiation will take place.
profileThe SASL profile selected.
statusA reference to a VortexStatus variable to notify caller SASL finish status.
status_messageA reference to notify the caller a textual diagnostic about SASL finish status.

References vortex_async_queue_new(), vortex_async_queue_pop(), vortex_async_queue_ref(), vortex_async_queue_timedpop(), vortex_async_queue_unref(), vortex_connection_get_ctx(), vortex_connection_get_timeout(), vortex_connection_set_data(), vortex_connection_set_data_full(), vortex_sasl_start_auth(), and VortexError.