A Connection object represents an application's active connection to a broker.
For a list of the XMS defined properties of a Connection object, see Properties of Connection.
Function | Description |
---|---|
xmsConnClose | Close the connection. |
xmsConnCreateSession | Create a session. |
xmsConnGetClientID | Get the client identifier for the connection. |
xmsConnGetExceptionListener | Get pointers to the exception listener function and context data that are registered with the connection. |
xmsConnGetMetaData | Get the metadata for the connection. |
xmsConnSetClientID | Set a client identifier for the connection. |
xmsConnSetExceptionListener | Register an exception listener function and context data with the connection. |
xmsConnStart | Start, or restart the delivery of incoming messages for the connection. |
xmsConnStop | Stop the delivery of incoming messages for the connection. |
xmsRC xmsConnClose(xmsHConn *connection, xmsHErrorBlock errorBlock);
If an application tries to close a connection that is already closed, the call is ignored.
xmsRC xmsConnCreateSession(xmsHConn connection, xmsBOOL transacted, xmsINT acknowledgeMode, xmsHSess *session, xmsHErrorBlock errorBlock);
For a real-time connection to a broker, the value must be xmsFALSE.
This parameter is ignored if the session is transacted. For more information about acknowledgement modes, see Message acknowledgement.
xmsRC xmsConnGetClientID(xmsHConn connection, xmsCHAR *clientID, xmsINT length, xmsINT *actualLength, xmsHErrorBlock errorBlock);
Get the client identifier for the connection.
This function is not valid for a real-time connection to a broker.
For more information about how to use this function, see C functions that return a string by value.
xmsRC xmsConnGetExceptionListener(xmsHConn connection, fpXMS_EXCEPTION_CALLBACK *lsr, xmsCONTEXT *context, xmsHErrorBlock errorBlock);
Get pointers to the exception listener function and context data that are registered with the connection.
For more information about using exception listener functions, see Exception listener functions in C.
xmsRC xmsConnGetMetaData(xmsHConn connection, xmsHConnMetaData *connectionMetaData, xmsHErrorBlock errorBlock);
Get the metadata for the connection.
xmsRC xmsConnSetClientID(xmsHConn connection, xmsCHAR *clientID, xmsINT length, xmsHErrorBlock errorBlock)
Set a client identifier for the connection. A client identifier is used only to support durable subscriptions in the publish/subscribe domain, and is ignored in the point-to-point domain.
If an application calls this function to set a client identifier for a connection, the application must do so immediately after creating the connection, and before performing any other operation on the connection. If the application tries to call the function after this point, the function returns exception XMS_X_ILLEGAL_STATE_EXCEPTION.
This method is not valid for a real-time connection to a broker.
xmsRC xmsConnSetExceptionListener(xmsHConn connection, fpXMS_EXCEPTION_CALLBACK lsr, xmsCONTEXT context, xmsHErrorBlock errorBlock);
Register an exception listener function and context data with the connection.
For more information about using exception listener functions, see Exception listener functions in C.
xmsRC xmsConnStart(xmsHConn connection, xmsHErrorBlock errorBlock);
Start, or restart the delivery of incoming messages for the connection. The call is ignored if the connection is already started.
xmsRC xmsConnStop(xmsHConn connection, xmsHErrorBlock errorBlock);
Stop the delivery of incoming messages for the connection. The call is ignored if the connection is already stopped.