mi_integer mi_set_connection_user_data(conn, user_data_ptr)
MI_CONNECTION *conn;
void *user_data_ptr;
can be a pointer to a session-duration connection descriptor established by a previous call to mi_get_session_connection( ). Use of a session-duration connection descriptor is a advanced feature of the DataBlade API.
Valid in Client LIBMI Application? | Valid in User-Defined Routine? |
---|---|
Yes | Yes |
The mi_set_connection_user_data( ) function assigns the user-data pointer that user_data_ptr references to the connection descriptor that conn references. The user-data pointer is the address to a user-defined buffer or structure that contains private information you want to keep with the specified connection.
The DataBlade API does not interpret or touch the associated user-data pointer, other than to store it in the connection descriptor. Cast the user_data_ptr pointer to void * before you store it as user data in a connection descriptor.
You can obtain the user-data pointer from a connection descriptor with the mi_get_connection_user_data( ) function.
See also the description of mi_get_connection_user_data( ).