axl_bool vortex_connection_pop_channel_error ( VortexConnection connection,
int *  code,
char **  msg 

Allows to get the next channel error message stored in the provided connection.

Every time a channel creation attempt finish without the channel created an error code and a textual diagnostic is returned by the remote side. This function allows to get that messages.

The function returns axl_true if a pending channel creation error message was stored in the connection. You must provide reference to store the content and the caller will own references returned. This means you must deallocate memory returned by this function on success.

This function is mainly provided to check errors once a channel creation fails. Here is an example:

1 VortexChannel * channel;
2 char * msg;
3 int code;
5 // attempt a channel creation (using conn)
6 channel = vortex_channel_new (....);
8 if (channel == NULL) {
9  // channel have failed
10  while (vortex_connection_pop_channel_error (conn, &code, &msg)) {
11  // drop a error message
12  printf ("Channel have failed, error was: code=%d, %s\n",
13  code, msg);
14  // dealloc resources
15  axl_free (msg);
16  }
17 }
connectionThe connection where the error is expected to be stored.
codeThe error found code. This reference is not optional, you must provide it.
msgThe textual error received. This reference is not optional, you must provide it.
axl_true if an error message was pending to be retrieved, otherwise axl_false is returned. The function also returns axl_false if some argument is null.

References vortex_mutex_lock(), and vortex_mutex_unlock().