Unsolicited message handling
◆ tpbroadcast()
native void org.endurox.AtmiCtx.tpbroadcast |
( |
String |
lmid, |
|
|
String |
usrname, |
|
|
String |
cltname, |
|
|
TypedBuffer |
idata, |
|
|
long |
flags |
|
) |
| |
Broadcast a message to matched clients or send message to remove remote server's '@TPBROADNNN' service for local broadcasting. See tpbroadcast(3) manpage for more information.
- Parameters
-
lmid | cluster node id to which message shall be delivered. if flag TPREGEXMATCH is present, then regexp is used for the given string to match the cluster nodes to which message shall be delivered. Max string length is MAXTIDENT*2-1. |
usrname | this is reserved for future use. |
cltname | executable name which shall be matched for notification delivery. If flag TPREGEXMATCH is set, then this is regular expression of the binary name to be matched. Max string length in bytes are MAXTIDENT*2-1. |
idata | input typed buffer (can be null) for notification delivery |
flags | following broadcast flags may be set:
- TPNOBLOCK Do not block on full client queue, instead return error.
- TPNOTIME Do not timeout when waiting on full queue (TPNOBLOCK is not set).
- TPSIGRSTRT Restart the system call in progress if interrupted by signal handler. This affects only underlaying mq_* function calls.
- TPREGEXMATCH Match lmid (cluster node id) and cltname by assuming that these are regular expressions.
|
- Exceptions
-
AtmiTPEINVALException | Environment variables not configured, see ex_env(5) page, or invalid parameters have been passed to the function, for example clientid, lmtid or username are set and they are invalid regular expressions (i.e. with TPREGEXMATCH set). |
AtmiTPESYSTEException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
◆ tpchkunsol()
native int org.endurox.AtmiCtx.tpchkunsol |
( |
| ) |
|
Process received unsolicited messages and invoke callback set by tpsetunsol(). See tpchkunsol(3) manpage for more information.
- Returns
- Number of unsolicited messages processed
- Exceptions
-
AtmiTPESYSTEMException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
◆ tpnotify()
Send notification to clients See tpnotify(3) manpage for more information.
- Parameters
-
clientid | client id (received in service call) |
idata | input typed buffer |
flags | valid flags:
- TPNOBLOCK Do not block on full client queue, instead return error.
- TPNOTIME Do not timeout when waiting on full queue (TPNOBLOCK is not set).
- TPSIGRSTRT Restart the system call in progress if interrupted by signal handler. This affects only underlaying mq_* function calls.
- TPACK Reserved for future use, Enduro/X silently ignores this flag. Thus tpnotify() call does not get any acknowledgement signal that client is processed the message. This is limitation of Enduro/X.
|
- Exceptions
-
AtmiTPEINVALException | Environment variables not configured, see ex_env(5) page, or invalid parameters have been passed to the function, for example clientid is NULL or corrupted. |
AtmiTPENOENTException | The local delivery was about to be performed (no remote client call) and the client process did not exist on local machine. This error will be reported regardless of the TPACK flag. |
AtmiTPETIMEException | Blocking message delivery did timeout. Meaning that client queue was full and TPNOBLOCK nor TPNOTIME was set. Error is returned from local clients only regardless of the TPACK flag. If client resists on remote node, then this error can be returned only when time-out occurred while s ending message to then local bridge server. |
AtmiTPEBLOCKException | Client queue was full and TPNOBLOCK flag was not specified. |
AtmiTPESYSTEMException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
◆ tpsetunsol()
Register unsolicited message callback handler See tpsetunsol(3) manpage for more information.
- Parameters
-
- Returns
- previous callback handler
- Exceptions
-
AtmiTPEINVALException | Environment variables not configured, see ex_env(5) page. |
AtmiTPESYSTEMException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |
AtmiTPEOSException | System failure occurred during serving. See logs i.e. user log, or debugs for more info. |