static qBool CreateOrJoinSession( void(*)() pfCreateCallback = NULL, SessionDescription *(*)(qList< SessionDescription > &lstSessions) pfSessionSelection = NULL );
Name | Description | |
---|---|---|
in | pfCreateCallback | Specifies the callback function to call when creating a session (default is NULL). If an existing object in the DDL (Data Definition Language) is already defined, you must create all existing objects inside this callback function. You can also use this function to set session descriptor SessionDescription information before a session is created. |
in | pfSessionSelection | Specifies the callback function used to determine which session to join when multiple sessions have been found. If this pointer is NULL (default), Net-Z automatically joins the first session found. |
Value | Description |
---|---|
true |
Returned when a session is successfully joined or created. |
false |
Returned if participation or creation of a session failed, or if an error has occurred. SYSTEMERROR_DC_CLUSTER_JOIN_DENIED is signaled if internal Net-Z authentication fails. SYSTEMERROR_OBJDUP_WKHANDLE_WERE_CREATED is signaled if an existing object was created when attempting to join a found session. (Only the session master can create an existing object.) SYSTEMERROR_OBJDUP_WKHANDLE_NOT_INITIALIZED is signaled if an existing object was not created when attempting to create a session rather than find one. (An existing object must be created when creating a session.) SYSTEMERROR_DC_CLUSTER_REDEFINITION is signaled when an attempt is made to join or create multiple sessions. |
Tries to join an existing session, or creates a new session if no sessions are found.
This function is a wrapper to the three functions: QuerySessions
, JoinSession
, and CreateSession
. When this function is called, it enumerates sessions created by processes connected to the same access point. It works like the QuerySessions
function in this respect. If found, which session is joined pfSessionSelection
callback.JoinSession
function.
If processes connected to the same access point have not opened a session, the device executing this function becomes the parent, and the session is created as it is using CreateSession
. Before a session is created, pfCreateCallback
function is called.
Note: This function was designed for debugging. Do not use this function in product releases.
CONFIDENTIAL