|
Functions | |
| MQ_EXTERN enum MqErrorE | MqSendY (struct MqS *const context, const MQ_BYT val) |
| append a native typed value to the Send-Buffer object | |
| MQ_EXTERN enum MqErrorE | MqSendO (struct MqS *const context, const MQ_BOL val) |
| MQ_EXTERN enum MqErrorE | MqSendS (struct MqS *const context, const MQ_SRT val) |
| MQ_EXTERN enum MqErrorE | MqSendI (struct MqS *const context, const MQ_INT val) |
| MQ_EXTERN enum MqErrorE | MqSendF (struct MqS *const context, const MQ_FLT val) |
| MQ_EXTERN enum MqErrorE | MqSendW (struct MqS *const context, const MQ_WID val) |
| MQ_EXTERN enum MqErrorE | MqSendD (struct MqS *const context, const MQ_DBL val) |
| MQ_EXTERN enum MqErrorE | MqSendC (struct MqS *const context, MQ_CST const in) |
| append a MQ_STR object to the Send-Buffer object | |
| MQ_EXTERN enum MqErrorE | MqSendB (struct MqS *const context, MQ_BINB const *const in, MQ_SIZE const len) |
| append a MQ_BIN object to the Send-Buffer object | |
| MQ_EXTERN enum MqErrorE | MqSendU (struct MqS *const context, struct MqBufferS *const in) |
| append a MQ_BUF object to the Send-Buffer object | |
| MQ_EXTERN enum MqErrorE | MqSendL (struct MqS *const context, struct MqBufferLS const *const in) |
| append a MqBufferLS object to the Send-Buffer object | |
| MQ_EXTERN enum MqErrorE | MqSendV (struct MqS *const context, MQ_CST const fmt,...) |
| append a vararg string to the Send-Buffer object | |
| MQ_EXTERN enum MqErrorE | MqSendVL (struct MqS *const context, MQ_CST const fmt, va_list var_list) |
| append a vararg string as va_list to the Send-Buffer object | |
| MQ_EXTERN enum MqErrorE | MqSendSTART (struct MqS *const context) |
| initialize the Send-Buffer object and start to create a Msgque package | |
| MQ_EXTERN enum MqErrorE | MqSendEND (struct MqS *const context, MQ_CST const token) |
| finish and send a service Msgque packet without waiting on return | |
| MQ_EXTERN enum MqErrorE | MqSendEND_AND_WAIT (struct MqS *const context, MQ_CST const token, MQ_TIME_T const timeout) |
| send a service Msgque packet and waiting on return | |
| MQ_EXTERN enum MqErrorE | MqSendEND_AND_CALLBACK (struct MqS *const context, MQ_CST const token, MqTokenF const proc, MQ_PTR data, MqTokenDataFreeF datafreeF) |
| send a service Msgque packet with a callback function defined | |
| MQ_EXTERN enum MqErrorE | MqSendRETURN (struct MqS *const context) |
| send a return Msgque packet with data from the current MqErrorS object | |
| MQ_EXTERN enum MqErrorE | MqSendERROR (register struct MqS *const context) |
| send a msgque error from a server to a client | |
| MQ_EXTERN enum MqErrorE | MqSendFTR (struct MqS *const context, MQ_TIME_T const timeout) |
send a _FTR filter package | |
| MQ_EXTERN enum MqErrorE | MqSendEOF (struct MqS *const context, MQ_TIME_T const timeout) |
send a _EOF filter package | |
| MQ_EXTERN enum MqErrorE | MqSendL_START (struct MqS *const context) |
| start to append an embedded list item to the Send-Buffer object | |
| MQ_EXTERN enum MqErrorE | MqSendL_END (struct MqS *const context) |
| end to append an embedded list item to the Send-Buffer object | |
the management is done by a Send-Buffer object using an Io object for doing the socket io. Every msgque object has only one Send-Buffer object and every Send-Buffer object has only one link to a MqS object.
example 1: in the client, calling the service and wait for an answer
void MyServiceCall(struct MqS * const context) { // the libmsgque object ... MqSendSTART(context); // init the Send-Buffer object MqSendI(context,int_value); // 1. argument: a MQ_INT value MqSendV(context,"num:%x",num); // 2. argument: a vararg string value MqSendB(context,mypicture,size); // 3. argument: a binary picture of size length // call service "SRV1" and wait maximum 60 seconds for the results MqErrorCheck(MqSendEND_AND_WAIT(context,"SRV1",60); // ... get the results MqErrorCheck(MqReadI(context, ???); ... }
example 2: in the server, answer the service call
static MqErrorE Ot_WAR1(struct MqS * const context, MQ_PTR data) { // ... do some int work MqSendSTART(context); // init the Send-Buffer object MqErrorCheck(MqReadI(context,&myInt); // read a MQ_INT value MqErrorCheck(MqReadC(context,&myStr); // read a MQ_STR value MqErrorCheck(MqReadU(context,&myPic); // read a MqBufferS object to store the picture data // ... do some processing error: // something is wrong, error back return MqSendRETURN(context); // send the package as an answer of a previous service-call }
| MQ_EXTERN enum MqErrorE MqSendB | ( | struct MqS *const | context, | |
| MQ_BINB const *const | in, | |||
| MQ_SIZE const | len | |||
| ) |
append a MQ_BIN object to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| in | the binary data to send | |
| len | the size of the binary data to send |
Definition at line 481 of file send.c.
References MqBufferU::B, MqSendS::buf, BUFFER_P2_PRENUM, MqS::config, MqBufferS::cur, MqConfigS::isString, MqS::link, MQ_BINT, MQ_ERROR_CONNECTED, MQ_OK, MqErrorDbV, pBufferAddSize, MqLinkS::send, sSendLen(), and unlikely.
Referenced by MqSendU().

append a MQ_STR object to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| in | the string data to send |
Definition at line 461 of file send.c.
References MqBufferU::B, MqSendS::buf, BUFFER_P2_PRENUM, MqBufferU::C, MqS::config, MqBufferS::cur, MqConfigS::isString, MqS::link, MQ_ERROR_CONNECTED, MQ_OK, MQ_STRT, MqErrorDbV, pBufferAddSize, MqLinkS::send, sSendLen(), and unlikely.
Referenced by MqLinkCreate(), MqSendERROR(), MqSendRETURN(), MqSendU(), and pMqShutdown().

append a native typed value to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | val | the value to send |
Definition at line 450 of file send.c.
References MqS::config, MqBufferAtomU::D, MqConfigS::isString, MqS::link, MQ_DBLT, MqLinkS::send, and sSendA8().
Referenced by MqSendU().

finish and send a service Msgque packet without waiting on return
This function is used to call a remote service or answer a service-call.
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | token | a 4 byte string used to identify the remote service |
Definition at line 655 of file send.c.
References pMqSendEND(), and pSendL_CLEANUP().
Referenced by MqProcessEvent(), and MqSendERROR().

| MQ_EXTERN enum MqErrorE MqSendEND_AND_CALLBACK | ( | struct MqS *const | context, | |
| MQ_CST const | token, | |||
| MqTokenF const | proc, | |||
| MQ_PTR | data, | |||
| MqTokenDataFreeF | datafreeF | |||
| ) |
send a service Msgque packet with a callback function defined
This function is used to call a remote service and don't wait for an answer. The answer will be processed asynchronous in MqProcessEvent.
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | token | a 4 byte string used to identify the remote service |
| [in] | proc | A service procedure called with the results of the transaction |
| [in] | data | A user defined additional data |
| [in] | datafreeF | A function to free data after use |
Definition at line 831 of file send.c.
References MqS::link, MqErrorReturn, pMqSendEND(), pSendL_CLEANUP(), pTransPop(), and MqLinkS::trans.
| MQ_EXTERN enum MqErrorE MqSendEND_AND_WAIT | ( | struct MqS *const | context, | |
| MQ_CST const | token, | |||
| MQ_TIME_T const | timeout | |||
| ) |
send a service Msgque packet and waiting on return
This function is used to call a remote service and wait for an answer.
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | token | a 4 byte string used to identify the remote service |
| timeout | time_t type value for timeout in seconds |
Definition at line 735 of file send.c.
References MqLinkS::_trans, MqS::link, MQ_CONTINUE, MQ_ERROR, MQ_EXIT, MQ_OK, MQ_RETURN_ERROR, MQ_RETURN_OK, MQ_TRANS_CANCEL, MQ_TRANS_END, MQ_TRANS_START, MQ_WAIT_ONCE, MqDLogC, MqErrorC(), MqErrorCheck, MqErrorStack, MqErrorV, MqPanicC, MqProcessEvent(), MqReadC(), MqReadItemExists(), pCachePush(), pErrorAppendC(), pMqSendEND(), pRead_RET_END, pRead_RET_START(), pReadGetReturnCode(), pReadGetReturnNum(), pSendL_CLEANUP(), pTransCheckStart(), pTransGetLast(), pTransGetResult(), pTransGetStatus(), pTransPop(), pTransPush(), MqLinkS::read, MqLinkS::readCache, and MqLinkS::trans.
Referenced by MqLinkCreate(), MqSendEOF(), MqSendFTR(), and pMqShutdown().

send a _EOF filter package
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | timeout | timeout used for send data |
(MqConfigS::isServer == MQ_NO)Definition at line 868 of file send.c.
References MqSendS::context, MqS::link, MQ_ERROR_EXPECT_FILTER, MQ_IS_SERVER, MqErrorDbV, MqErrorReturn, MqSendEND_AND_WAIT(), MqSendSTART(), and MqLinkS::send.
Referenced by pTokenCheckSystem().

send a msgque error from a server to a client
Utility function to simplify the send task for a service handle.
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 1043 of file send.c.
References MqErrorCheck, MqErrorGetNum(), MqErrorGetText(), MqErrorReset(), MqErrorStack, MqSendC(), MqSendEND(), MqSendI(), MqSendSTART(), pReadL_CLEANUP(), and pSendL_CLEANUP().
Referenced by MqSendRETURN(), pErrorReport(), pEventStart(), pSlaveBqError(), and sMqEventStart().

append a native typed value to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | val | the value to send |
Definition at line 428 of file send.c.
References MqS::config, MqBufferAtomU::F, MqConfigS::isString, MqS::link, MQ_FLTT, MqLinkS::send, and sSendA4().
Referenced by MqSendU().

send a _FTR filter package
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | timeout | timeout used for send data |
(MqConfigS::isServer == MQ_NO)Definition at line 855 of file send.c.
References MqSendS::context, MqS::link, MQ_ERROR_EXPECT_FILTER, MQ_IS_SERVER, MqErrorDbV, MqErrorReturn, MqSendEND_AND_WAIT(), pReadL_CLEANUP(), and MqLinkS::send.
Referenced by pTokenCheckSystem().

append a native typed value to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | val | the value to send |
Definition at line 417 of file send.c.
References MqS::config, MqBufferAtomU::I, MqConfigS::isString, MqS::link, MQ_INTT, MqLinkS::send, and sSendA4().
Referenced by MqLinkCreate(), MqSendERROR(), and MqSendU().

| MQ_EXTERN enum MqErrorE MqSendL | ( | struct MqS *const | context, | |
| struct MqBufferLS const *const | in | |||
| ) |
append a MqBufferLS object to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| in | the pointer to an MqBufferLS object to send |
Definition at line 542 of file send.c.
References MqBufferLS::cursize, MqBufferLS::data, MqS::link, MQ_ERROR_CONNECTED, MQ_OK, MqErrorDbV, MqSendU(), MqLinkS::send, and unlikely.
end to append an embedded list item to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 920 of file send.c.
References MqBufferU::B, MqSendS::buf, MqSendS::cache, MqS::config, MqBufferS::cur, SendSaveS::cursize, MqBufferS::cursize, MqBufferS::data, MqConfigS::isString, MqS::link, MQ_ERROR_CONNECTED, MQ_LSTT, MQ_OK, MqErrorDbV, SendSaveS::numItems, MqBufferS::numItems, pCachePush(), MqSendS::save, SendSaveS::save, MqLinkS::send, SEND_I, sSendLen(), and unlikely.
Referenced by MqSendU(), and pSendL_CLEANUP().

start to append an embedded list item to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
MqSendL_START(send); // start a LST item MqSendI(send,myInt); // first LST sub-item MqSendC(send,"myString"); // second LST sub-item // ... do additional MqSend? MqSendL_END(send); // finish a LST item
Definition at line 887 of file send.c.
References MqBufferU::B, MqSendS::buf, BUFFER_P2_PRENUM, MqSendS::cache, MqBufferS::cur, SendSaveS::cursize, MqBufferS::cursize, HDR_INT_LEN, MqS::link, MQ_ERROR_CONNECTED, MQ_OK, MqErrorDbV, MqBufferS::numItems, SendSaveS::numItems, pBufferAddSize, pCachePop(), MqSendS::save, SendSaveS::save, and MqLinkS::send.
Referenced by MqSendU().

append a native typed value to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | val | the value to send |
Definition at line 395 of file send.c.
References MqS::config, MqConfigS::isString, MqS::link, MQ_BOLT, MqBufferAtomU::O, MqLinkS::send, and sSendA1().
Referenced by MqLinkCreate(), MqSendU(), and pTokenCheckSystem().

send a return Msgque packet with data from the current MqErrorS object
Utility function to simplify the send task for a service handle.
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 1059 of file send.c.
References MqLinkS::_trans, MqS::link, MQ_CONTINUE, MQ_ERROR, MQ_ERROR_RETURN_WITHOUT_TRANSACTION, MQ_EXIT, MQ_OK, MQ_RETURN_ERROR, MqDLogC, MqErrorCheck, MqErrorDb, MqErrorGetCode(), MqErrorGetNum(), MqErrorGetText(), MqErrorReset(), MqErrorStack, MqPanicSYS, MqSendC(), MqSendERROR(), MqSendSTART(), pMqSendEND(), pReadL_CLEANUP(), pSendL_CLEANUP(), sSend_RET_END(), and sSend_RET_START().
Referenced by pEventStart(), pMqShutdown(), pTokenCheckSystem(), and sMqEventStart().

append a native typed value to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | val | the value to send |
Definition at line 406 of file send.c.
References MqS::config, MqConfigS::isString, MqS::link, MQ_SRTT, MqBufferAtomU::S, MqLinkS::send, and sSendA2().
Referenced by MqSendU().

initialize the Send-Buffer object and start to create a Msgque package
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 614 of file send.c.
References MqBufferU::B, HdrIU::B, MqSendS::buf, HdrS::charS, HdrS::code, MqS::config, MqLinkS::ctxId, HdrS::ctxId, MqBufferS::cur, MqBufferS::cursize, MqBufferS::data, MqSendS::haveStart, HDR_INT_LEN, MqConfigS::isString, MqS::link, MQ_BINT, MQ_ERROR_CONNECTED, MQ_OK, MQ_RETURN_OK, MQ_STRT, MQ_YES, MqErrorDbV, MqBufferS::numItems, HdrIU::S, MqSendS::save, MqLinkS::send, SEND_IS, MqBufferS::type, and unlikely.
Referenced by MqLinkCreate(), MqProcessEvent(), MqSendEOF(), MqSendERROR(), MqSendRETURN(), pEventStart(), pMqShutdown(), pTokenCheckSystem(), and sSend_RET_START().

append a MQ_BUF object to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| in | the pointer to an MqBufferS object to send |
Definition at line 502 of file send.c.
References MqBufferU::A, MqBufferU::B, MqSendS::buf, MqBufferU::C, MqBufferS::cur, MqBufferS::cursize, MqBufferAtomU::D, MqBufferS::data, MqBufferAtomU::F, MqBufferAtomU::I, MqS::link, MQ_BINT, MQ_BOLT, MQ_BYTT, MQ_DBLT, MQ_ERROR_CONNECTED, MQ_FLTT, MQ_INTT, MQ_LSTT, MQ_OK, MQ_RETT, MQ_SRTT, MQ_STRT, MQ_WIDT, MqErrorDbV, MqPanicSYS, MqReadItemExists(), MqReadL_END(), MqReadL_START(), MqReadU(), MqSendB(), MqSendC(), MqSendD(), MqSendF(), MqSendI(), MqSendL_END(), MqSendL_START(), MqSendO(), MqSendS(), MqSendU(), MqSendW(), MqSendY(), MqBufferAtomU::O, MqBufferAtomU::S, MqLinkS::send, MqBufferS::type, unlikely, MqBufferAtomU::W, and MqBufferAtomU::Y.
Referenced by MqReadProxy(), MqSendL(), MqSendU(), and pTokenCheckSystem().

append a vararg string to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| fmt | a printf like format string |
Definition at line 584 of file send.c.
References MqSendVL().
append a vararg string as va_list to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| fmt | a printf like format string | |
| var_list | a variable argument list object |
Definition at line 561 of file send.c.
References MqBufferU::B, MqSendS::buf, BUFFER_P2_PRENUM, MqS::config, MqBufferS::cur, MqBufferS::cursize, MqConfigS::isString, MqS::link, MQ_ERROR_CONNECTED, MQ_OK, MQ_STRT, MqBufferAppendVL(), MqErrorDbV, pBufferAddSize, MqLinkS::send, sSendLen(), and unlikely.
Referenced by MqSendV().

append a native typed value to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | val | the value to send |
Definition at line 439 of file send.c.
References MqS::config, MqConfigS::isString, MqS::link, MQ_WIDT, MqLinkS::send, sSendA8(), and MqBufferAtomU::W.
Referenced by MqSendU().

append a native typed value to the Send-Buffer object
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | val | the value to send |
Definition at line 384 of file send.c.
References MqS::config, MqConfigS::isString, MqS::link, MQ_BYTT, MqLinkS::send, sSendA1(), and MqBufferAtomU::Y.
Referenced by MqSendU().

1.5.8