Loading...
 

CX_CORBA_MANAGER::SendMsg

CX_CORBA_MANAGER::SendMsg

Description:

Sends a message via the Corba interface. Only the last part of the schema "ClassiX"/<current Project>/"RemoteMsg"/<Name> has to be entered as the name of the recipient, the Parent Naming Context ("ClassiX") and the name of the interface ("RemoteMsg") will be added internally. the project can be set beforehand using SetProject.

If no recipient is specified (NULL or "") it is assumed that this message is the result of a synchronous call. The message name is ignored in this case. If no client is waiting for a response, an exception is thrown.

The return value indicates whether an error was detected. The value 0 means no error was detected. Values unequal to 0 indicate an error. Not all errors can be detected locally, in particular 0 can be returned although the recipient was not able to receive the message in time.

This command can only be used to send a string to the recipient. To send several data, they must either be encoded into the string (and decoded by the recipient) or the InstantView command SendMsg(, REMOTE) must be used.

Code example:

In this example a Corbamanager is created first. Then the message "CLOSE" together with an empty string is sent to the recipient "cxsendmsg1". The return value of this operation is saved in a variable.

Var(CM)

Var(Status)

GetManager(CORBA) -> CM

"cxsendmsg1" "CLOSE" "" CM Call(SendMsg) -> Status

The following example demonstrates how to receive and send a response (string "OK"):

RECEIVE_REMOTE_MSG:

    Var(CM)

    GetManager(CORBA) -> CM

    NULL "RECEIVE_REMOTE_MSG" "OK" CM Call(SendMsg)

Stack
Stack Position Object type Brief description
Stack(In) Top STRING String to be sent with the message.
Top 1 STRING The name of an InstantView message.
top 2 STRING The Corban name of the recipient (e.g. "cxsendmsg1"). NULL or "" means that this is the response to a synchronous CORBA call.
Stack(Out) Top INTEGER A status code indicating whether an error has been detected.
Function call: Call(SendMsg)