MqContextC - various functions to work on a context … More...
Functions | |
MQ_CTX | MqGetRoot (MQ_CTX ctx) |
get the Root (toplevel initial context) | |
MQ_CTXN | MqGetRootN (MQ_CTXN ctx) |
(const) get the Root (toplevel initial context) | |
MQ_EXTERN void | MqExit_RT (MK_RT const mkrt, MQ_CTX const ctx, MK_STRN const callfunc, MK_STRN const callfile, MK_I32 const callline) MK_NO_RETURN |
delete the context and exit the current process or thread … | |
MQ_EXTERN void | MqContextMark_RT (MK_RT const mkrt, MQ_CTX const ctx) |
Mark objects as used to avoid the freeing of used external memory in an external Garbage-Collection … | |
MQ_EXTERN enum MkErrorE | MqCheckForLeftOverArguments_RT (MK_RT const mkrt, MQ_CTX const ctx, MK_BFLN args) |
check for left over arguments from parameter args of MqLinkCreate … | |
MQ_EXTERN MK_BUF | MqContextGetBuffer_RT (MK_RT const mkrt, MQ_CTX const ctx) |
get the MqContextS::ctxbuf object | |
MQ_EXTERN enum MkErrorE | MqProcessEvent_RT (MK_RT const mkrt, MQ_CTX const ctx, enum MqWaitOnEventE const wait, MK_TIME_T timeout) |
enter the event-loop and wait for an incoming service-request. … | |
MQ_EXTERN MK_STRN | MqContextToString_RT (MK_RT const mkrt, MQ_CTXN const ctx) |
String-Slot - returns the string representation of the inst … | |
MqContextC - MqContextC_MiscApi_Misc_C_API - function | |
MQ_EXTERN MQ_CTX | MqGetRootP (MQ_CTX ctx) |
Non-inline replacement for MqGetRoot … | |
MqContextC - MqContextC_MiscApi_Misc_C_API - overload | |
#define | MqContextGetBuffer_NULL(...) |
#define | MqContextGetBuffer(...) |
#define | MqCheckForLeftOverArguments_NULL(...) |
#define | MqCheckForLeftOverArguments(...) |
#define | MqCheckForLeftOverArguments_E(...) |
#define | MqCheckForLeftOverArguments_C(...) |
#define | MqContextMark_NULL(...) |
#define | MqContextMark(...) |
#define | MqContextToString_NULL(...) |
#define | MqContextToString(...) |
#define | MqExit_NULL(...) |
#define | MqExit(...) |
#define | MqExit_3(ctx, callfunc, callfile) |
#define | MqExit_2(ctx, callfunc) |
#define | MqExit_1(ctx) |
#define | MqProcessEvent_NULL(...) |
#define | MqProcessEvent(...) |
#define | MqProcessEvent_2(ctx, wait) |
#define | MqProcessEvent_1(ctx) |
#define | MqProcessEvent_E(...) |
#define | MqProcessEvent_C(...) |
MqContextC - various functions to work on a context …
#define MqCheckForLeftOverArguments | ( | ... | ) |
Definition at line 306 of file msgque_overload_mq.h.
#define MqCheckForLeftOverArguments_C | ( | ... | ) |
Definition at line 308 of file msgque_overload_mq.h.
#define MqCheckForLeftOverArguments_E | ( | ... | ) |
Definition at line 307 of file msgque_overload_mq.h.
#define MqCheckForLeftOverArguments_NULL | ( | ... | ) |
Definition at line 305 of file msgque_overload_mq.h.
#define MqContextGetBuffer | ( | ... | ) |
Definition at line 302 of file msgque_overload_mq.h.
#define MqContextGetBuffer_NULL | ( | ... | ) |
Definition at line 301 of file msgque_overload_mq.h.
#define MqContextMark | ( | ... | ) |
Definition at line 310 of file msgque_overload_mq.h.
#define MqContextMark_NULL | ( | ... | ) |
Definition at line 309 of file msgque_overload_mq.h.
#define MqContextToString | ( | ... | ) |
Definition at line 312 of file msgque_overload_mq.h.
#define MqContextToString_NULL | ( | ... | ) |
Definition at line 311 of file msgque_overload_mq.h.
#define MqExit | ( | ... | ) |
Definition at line 314 of file msgque_overload_mq.h.
#define MqExit_1 | ( | ctx | ) |
Definition at line 317 of file msgque_overload_mq.h.
#define MqExit_2 | ( | ctx, | |
callfunc ) |
Definition at line 316 of file msgque_overload_mq.h.
#define MqExit_3 | ( | ctx, | |
callfunc, | |||
callfile ) |
Definition at line 315 of file msgque_overload_mq.h.
#define MqExit_NULL | ( | ... | ) |
Definition at line 313 of file msgque_overload_mq.h.
#define MqProcessEvent | ( | ... | ) |
Definition at line 319 of file msgque_overload_mq.h.
#define MqProcessEvent_1 | ( | ctx | ) |
Definition at line 321 of file msgque_overload_mq.h.
#define MqProcessEvent_2 | ( | ctx, | |
wait ) |
Definition at line 320 of file msgque_overload_mq.h.
#define MqProcessEvent_C | ( | ... | ) |
Definition at line 323 of file msgque_overload_mq.h.
#define MqProcessEvent_E | ( | ... | ) |
Definition at line 322 of file msgque_overload_mq.h.
#define MqProcessEvent_NULL | ( | ... | ) |
Definition at line 318 of file msgque_overload_mq.h.
MQ_EXTERN enum MkErrorE MqCheckForLeftOverArguments_RT | ( | MK_RT const | mkrt, |
MQ_CTX const | ctx, | ||
MK_BFLN | args ) |
check for left over arguments from parameter args of MqLinkCreate …
This code is not part of MqLinkCreate because sometimes it is necessary to check for left over arguments after MqLinkCreate was called and after the calling function was able to process function specific arguments. By Default MqLinkCreate will delete all arguments belonging to libmqmsgque from the args object. If the calling function does not expect additional arguments or arguments were added with spelling errors, a call to MqCheckForLeftOverArguments will detect this.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | ctx | the MqContextS instance to work on |
[in,out] | args | the argument-list to check for left-over arguments |
get the MqContextS::ctxbuf object
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | ctx | the MqContextS instance to work on |
context->ctxbuf
objectMK_NULL
for a non-error result.Mark objects as used to avoid the freeing of used external memory in an external Garbage-Collection …
An external Garbage-Collection (GC) need information about external objects referenced by libmqmsgque. This objects are the MK_PTR data
parameter required by different functions.
To finally mark the object the MqCtxTypeS::dataMF and/or MqCtxTypeS::callbackMF functions are used.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | ctx | the MqContextS instance to work on |
String-Slot - returns the string representation of the inst …
The string is a human-readable form of the data stored in the object.
ToString
function by default.[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | ctx | the MqContextS instance to work on |
"MK_NULL"
on error MK_NULL
for a non-error result.MQ_EXTERN void MqExit_RT | ( | MK_RT const | mkrt, |
MQ_CTX const | ctx, | ||
MK_STRN const | callfunc, | ||
MK_STRN const | callfile, | ||
MK_I32 const | callline ) |
delete the context and exit the current process or thread …
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | ctx | the MqContextS instance to work on |
[in] | callfunc | a user-defined postfix to identify the calling function or the environment (default=name-of-function ) |
[in] | callfile | the name of the file the call take place (e.g. FILE) |
[in] | callline | the number of the line the call take place (e.g. LINE) |
To delete an application is a difficult task because the link-target have to be informed. This information is send as shutdown-event and finally as socket-exit after application-exit. This library tries to perform this two steps even if the default exit function is called. This is no problem because the second step (socket-exit) is enough to signal a link-down. It is not secure to depend only on socket-exit for application exit because sometimes the sockets stop working or the link-target does not get a socket-exit. For example the pipe-link on windows. The client can not exit and create a socket-exit error on the server because the server is still running without receiving a shutdown-event. A second argument for using the MqExit function is, that it can be used for process and thread exit. A thread, started by libmqmsgque, does exit but the process continue to work. To make it short use MqExit to exit your application.
The following steps are performed:
get the Root (toplevel initial context)
Definition at line 4417 of file LibMqMsgque_mq.h.
(const) get the Root (toplevel initial context)
Definition at line 4423 of file LibMqMsgque_mq.h.
MQ_EXTERN enum MkErrorE MqProcessEvent_RT | ( | MK_RT const | mkrt, |
MQ_CTX const | ctx, | ||
enum MqWaitOnEventE const | wait, | ||
MK_TIME_T | timeout ) |
enter the event-loop and wait for an incoming service-request. …
This function is used to enter the event-loop and start listen on open file-handles and to call IEvent on idle.
This function is mostly used on a server to enter the event-loop and wait for an incoming service request or on a client/server with all functions which exchange data like MqContextC SEND API, MqLinkConnect etc.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) | ||||||||||||
[in] | ctx | the MqContextS instance to work on | ||||||||||||
[in] | wait | the operation-mode used to define the behaviour, possible values are:
| ||||||||||||
[in] | timeout | in seconds until a timeout-error is raised, possible values are:
|