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:

 VortexChannel * channel;
 char          * msg;
 int             code;

 // attempt a channel creation (using conn)
 channel = vortex_channel_new (....);

 if (channel == NULL) {
      // channel have failed 
      while (vortex_connection_pop_channel_error (conn, &code, &msg)) {
             // drop a error message
             printf ("Channel have failed, error was: code=%d, %s\n",
                     code, msg);
             // dealloc resources 
             axl_free (msg);
      } 
 } 

Parameters:
connection The connection where the error is expected to be stored.
code The error found code.
msg The textual error received.
Returns:
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.