![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
When a program first opens a connection, the connection is stopped—that is, it does not deliver inbound messages. To begin the flow of inbound messages, the program must explicitly call tibemsConnection_Start. (Outbound messages flow even before calling tibemsConnection_Start.)The EMS C and COBOL APIs do not support the JMS methods createConnectionConsumer and createDurableConnectionConsumer (which are optional in the JMS specification).Asynchronous ErrorsWhen a program uses a connection to send messages, the send calls can detect problems with the connection, and notify the client program (synchronously) by returning error codes.However, when a program uses a connection only to receive messages, the client lacks that opportunity to detect problems. Instead, programs can handle such errors asynchronously by defining an exception listener callback (see tibemsExceptionCallback on page 219).
tibems_status tibemsConnection_Close(tibemsConnection connection );
connection has usage pointer.
Closing the connection is not sufficient to reclaim all of its resources; your program must explicitly close the sessions, producers, and consumers associated with the connection.If any message listener or receive call associated with the connection is processing a message when the program calls this function, all facilities of the connection and its sessions remain available to those listeners until they return. In the meantime, this function blocks until that processing completes—that is, until all message listeners and receive calls have returned.Closing a connection does not force acknowledgment in client-acknowledged sessions. When the program still has a message that it received from a connection that has since closed, tibemsMsg_Acknowledge indicates status code TIBEMS_ILLEGAL_STATE.Closing a connection rolls back all open transactions in all sessions associated with the connection.
tibems_status tibemsConnection_Create(tibemsConnection* connection,tibems_status tibemsConnection_CreateSSL(tibemsConnection* connection,tibemsSSLParams sslParams,
connection and sslParams have usage pointer.
Find the EMS server at this URL. If configuring a fault-tolerant client, enter two of more URLs, as described in Configuring C and COBOL Clients for Fault-Tolerant Connections. When the authentication parameters are null, the connection object presents a default user identity. If the server configuration permits that anonymous user, then the call succeeds.
• The call could not communicate with a server because of mismatched SSL and TCP protocols.
• The server rejected the connection because the username or password was invalid. The client ID is not unique; that is, another client already uses the ID.tibems_status tibemsConnection_CreateSession(tibemsConnection connection,tibemsSession* session,tibems_bool transacted,tibemsAcknowledgeMode acknowledgeMode );
connection and session have usage pointer.
tibems_status tibemsConnection_GetActiveURL(tibemsConnection connection,
connection and serverURL have usage pointer.
This property is the URL of the server at the other endpoint of the connection. When the connection interacts with several servers in a fault-tolerant arrangement, this property indicates the current active server.tibems_status tibemsConnection_GetClientId(tibemsConnection connection,
connection and clientId have usage pointer.
Client IDs partition the namespace of durable subscribers; see tibemsSession_CreateDurableSubscriber on page 289.tibems_status tibemsConnection_GetExceptionListener(tibemsConnection connection,tibemsExceptionCallback* listener,
The function stores a pointer to the exception listener closure argument in this location.This is an alternate pathway for alerting a client program of connection problems. The program defines an exception listener callback function, and registers the callback using tibemsConnection_SetExceptionListener. When the client library detects a connection problem, it calls the callback with an exception argument that details the problem.tibems_status tibemsConnection_GetMetaData(tibemsConnection connection,tibemsConnectionMetaData* metaData );
connection and metaData have usage pointer.
tibems_status tibemsConnection_IsDisconnected(tibemsConnection* connection,tibems_bool* disconnected);
connection has usage pointer.
This function gets a value indicating whether the connection is disconnected from the server. If the connection is disconnected from the server, tibemsConnection_IsDisconnected sets the the connection status to TRUE. Otherwise, the connection status is FALSE.That is, if the client has called tibemsConnection_Close, or if the connection has been terminated due to a network failure, tibemsConnection_IsDisconnected returns TRUE.tibems_status tibemsConnection_SetClientId(tibemsConnection connection,
connection has usage pointer.
Client IDs partition the namespace of durable subscribers; see tibemsSession_CreateDurableSubscriber on page 289.Administrators can configure connection factories to assign client IDs to new connections. Alternatively, administrators can allow client programs to assign their own IDs. If the factory does not assign an ID, the program may set this property. However, it is illegal to overwrite an existing client ID value, and or to set this property after using the connection in any way (for example, after creating a session, or starting the connection); attempting to set this property in these situations results in TIBEMS_ILLEGAL_STATE.tibems_status tibemsConnection_SetExceptionListener(tibemsConnection connection,tibemsExceptionCallback listener,BY VALUE TIBEMS-NULLPTR,
connection has usage pointer.tibems-Exception-Status has usage binary.
This is an alternate pathway for alerting a client program of connection problems. The program defines an exception listener callback function, and calls this function to register the callback and a closure argument. When the client library detects a connection problem, it calls the callback with a status code that identifies the problem.tibems_status tibemsConnection_Start(tibemsConnection connection );
connection has usage pointer.
When a connection is created, it is stopped. It does not deliver inbound messages until the program calls this function to explicitly start it.tibems_status tibemsConnection_Stop(tibemsConnection connection );
connection has usage pointer.
This call temporarily stops the connection from delivering inbound messages. A program can restart delivery by calling tibemsConnection_Start.When a connection is created, it is stopped. It does not deliver inbound messages until the program calls this function to explicitly start it.When this call returns, the connection has stopped delivery to all consumers associated with the connection:If any message listener or receive call associated with the connection is processing a message when the program calls this function, all facilities of the connection and its sessions remain available to those listeners until they return. In the meantime, this function blocks until that processing completes—that is, until all message listeners and receive calls have returned.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |