MqContextC - setup and manage a client-server-link … More...
Data Structures | |
struct | MqLinkSlaveS |
needed to "run-over-all-slaves" → example: MqRouteGetTree More... | |
struct | MqLinkS |
object responsible to manage a client/server link data More... | |
Functions | |
MQ_EXTERN enum MkErrorE | MqLinkCreate_RT (MK_RT const mkrt, MQ_CTX const ctx, MK_BAC args) |
make ctx to a parent-context and setup a new client-server-link … | |
MQ_EXTERN enum MkErrorE | MqLinkConnect_RT (MK_RT const mkrt, MQ_CTX const ctx) |
re-connect a client-server-link after a server crash or a network downtime … | |
MQ_EXTERN enum MkErrorE | MqLinkShutdown_RT (MK_RT const mkrt, MQ_CTX const ctx) |
shutdown the communication with a server | |
MQ_EXTERN enum MkErrorE | MqLinkCreateChild_RT (MK_RT const mkrt, MQ_CTX const ctx, MQ_CTX const parent, MK_BAC const args) |
make a context to a child-context on-top of an existing parent-client-server-link … | |
MQ_EXTERN enum MkErrorE | MqLinkDefault_RT (MK_RT const mkrt, MQ_CTX const ctx, MK_BAC const args) |
callback as wrapper for MqLinkCreate or MqLinkCreateChild with additional error-check code … | |
MQ_EXTERN void | MqLinkDelete_RT (MK_RT const mkrt, MQ_CTX const ctx) |
close the client-server-link … | |
MQ_EXTERN bool | MqLinkIsConnected (MQ_CTX const ctx) MK_ATTR_HDL |
is the context connected? … | |
MQ_CTX | MqLinkGetParent (MQ_CTX const ctx) |
get the initial parent-context from a client/server link … | |
bool | MqLinkIsParent (MQ_CTX const ctx) |
is the context a parent-context? … | |
MK_NUM | MqLinkGetCtxId (MQ_CTX const ctx) |
get an identifier which is unique per parent-or-child-context … | |
MK_STRN | MqLinkGetTargetIdent (MQ_CTX const ctx) |
get the ident of the link-target … | |
MqContextC - MqContextC_LinkApi_Link_C_API - function | |
MQ_EXTERN MQ_CTX | MqLinkGetParentP (MQ_CTX const ctx) |
Non-inline replacement for MqLinkGetParent … | |
MQ_EXTERN MK_NUM | MqLinkGetCtxIdP (MQ_CTX const ctx) |
Non-inline replacement for MqLinkGetCtxId … | |
MQ_EXTERN MK_STRN | MqLinkGetTargetIdentP (MQ_CTX const ctx) |
Non-inline replacement for MqLinkGetTargetIdent … | |
MQ_EXTERN MK_BOOL | MqLinkIsParentP (MQ_CTX const ctx) |
Non-inline replacement for MqLinkIsParent … | |
MqContextC - MqContextC_LinkApi_Link_C_API - overload | |
#define | MqLinkConnect_NULL(...) |
#define | MqLinkConnect(...) |
#define | MqLinkConnect_E(...) |
#define | MqLinkConnect_C(...) |
#define | MqLinkCreate_NULL(...) |
#define | MqLinkCreate(...) |
#define | MqLinkCreate_1(ctx) |
#define | MqLinkCreate_E(...) |
#define | MqLinkCreate_C(...) |
#define | MqLinkCreateChild_NULL(...) |
#define | MqLinkCreateChild(...) |
#define | MqLinkCreateChild_2(ctx, parent) |
#define | MqLinkCreateChild_E(...) |
#define | MqLinkCreateChild_C(...) |
#define | MqLinkDefault_NULL(...) |
#define | MqLinkDefault(...) |
#define | MqLinkDelete_NULL(...) |
#define | MqLinkDelete(...) |
#define | MqLinkShutdown_NULL(...) |
#define | MqLinkShutdown(...) |
#define | MqLinkShutdown_E(...) |
#define | MqLinkShutdown_C(...) |
MqContextC - setup and manage a client-server-link …
The client-server-link connect two context, a client-parent-context and a server-parent-context. The link can be local (connect two context on the same host) or can be remote (connect two context on different hosts). On-Top the parent-context multiple child-context are allowed.
!on remote host! !on local host! server1---------x x----------server2 | | | | | child-context-1 child-context-2 | | | | | server parent-context-1-----x x-----parent-context-2 | | (MqConfigS::server) (example: MqConfigS::server --fork --uds … --file …) | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | (--tcp) (--pipe, --uds, --tcp) | | parent-context-1-----x x-----parent-context-2 | | | | client | child-context-1 child-context-2 | | | | | x------------x--------client-------x-------------x !on local host!
Definition of a "client-context"
Definition of a "server-context"
Definition of a "parent-context"
Definition of a "child-context"
#define MqLinkConnect | ( | ... | ) |
Definition at line 219 of file msgque_overload_mq.h.
#define MqLinkConnect_C | ( | ... | ) |
Definition at line 221 of file msgque_overload_mq.h.
#define MqLinkConnect_E | ( | ... | ) |
Definition at line 220 of file msgque_overload_mq.h.
#define MqLinkConnect_NULL | ( | ... | ) |
Definition at line 218 of file msgque_overload_mq.h.
#define MqLinkCreate | ( | ... | ) |
Definition at line 223 of file msgque_overload_mq.h.
#define MqLinkCreate_1 | ( | ctx | ) |
Definition at line 224 of file msgque_overload_mq.h.
#define MqLinkCreate_C | ( | ... | ) |
Definition at line 226 of file msgque_overload_mq.h.
#define MqLinkCreate_E | ( | ... | ) |
Definition at line 225 of file msgque_overload_mq.h.
#define MqLinkCreate_NULL | ( | ... | ) |
Definition at line 222 of file msgque_overload_mq.h.
#define MqLinkCreateChild | ( | ... | ) |
Definition at line 228 of file msgque_overload_mq.h.
#define MqLinkCreateChild_2 | ( | ctx, | |
parent ) |
Definition at line 229 of file msgque_overload_mq.h.
#define MqLinkCreateChild_C | ( | ... | ) |
Definition at line 231 of file msgque_overload_mq.h.
#define MqLinkCreateChild_E | ( | ... | ) |
Definition at line 230 of file msgque_overload_mq.h.
#define MqLinkCreateChild_NULL | ( | ... | ) |
Definition at line 227 of file msgque_overload_mq.h.
#define MqLinkDefault | ( | ... | ) |
Definition at line 233 of file msgque_overload_mq.h.
#define MqLinkDefault_NULL | ( | ... | ) |
Definition at line 232 of file msgque_overload_mq.h.
#define MqLinkDelete | ( | ... | ) |
Definition at line 235 of file msgque_overload_mq.h.
#define MqLinkDelete_NULL | ( | ... | ) |
Definition at line 234 of file msgque_overload_mq.h.
#define MqLinkShutdown | ( | ... | ) |
Definition at line 237 of file msgque_overload_mq.h.
#define MqLinkShutdown_C | ( | ... | ) |
Definition at line 239 of file msgque_overload_mq.h.
#define MqLinkShutdown_E | ( | ... | ) |
Definition at line 238 of file msgque_overload_mq.h.
#define MqLinkShutdown_NULL | ( | ... | ) |
Definition at line 236 of file msgque_overload_mq.h.
re-connect a client-server-link after a server crash or a network downtime …
Do nothing if the client-server-link is already connected. This function is only useful in an event-function (IEvent) if the link-disconnect (ErrorIsEXIT) is ignored (ErrorReset). Read more from the: /example/c/Filter4.c
example.
[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 |
make ctx to a parent-context and setup a new client-server-link …
The goal of the MqLinkCreate is to setup a link to a new server-context on the SERVER.
The link is created with MqIoComE to a server started with MqStartE.
The argument args is a list of command-line-arguments to configure the client-server-link including the @ item to add server-command-line-arguments.
The following special-keyword as first argument after @ is recognized:
"@ SELF arg1…"
will be "@ executable factory-name arg1…"
"@ WORKER arg1…"
will be "@ executable arg1…"
The executable is defined by (static) void MqInitSetArg0(MK_BAC bfl)
and will be automatical set for a non C / C++ language.
[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] | args | command-line-arguments to configure the client-server-link |
MQ_EXTERN enum MkErrorE MqLinkCreateChild_RT | ( | MK_RT const | mkrt, |
MQ_CTX const | ctx, | ||
MQ_CTX const | parent, | ||
MK_BAC const | args ) |
make a context to a child-context on-top of an existing parent-client-server-link …
A child is using the same process or thread as the parent but a different namespace. With a different namespace a child is able to act on different services on the shared server.
[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] | parent | the parent-context defined with MqLinkCreate |
[in] | args | command-line-arguments to configure the client-server-link without the "@" item. |
callback as wrapper for MqLinkCreate or MqLinkCreateChild with additional error-check code …
The function have to be used as argument to MqCtxTypeS::Child or MqCtxTypeS::Parent as default context-create function. Return an error if an unknown command-line-argument was found.
[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] | args | command-line-arguments to configure the client-server-link with or without the "@" item. |
close the client-server-link …
On a client the context will be set to not-connected and the function MqLinkIsConnected will return MK_NO
. On a server the context will be deleted but only if MqSetupS::ignoreExit is not set to MK_YES
. If the link is already not-connected nothing will happen.
[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 |
get an identifier which is unique per parent-or-child-context …
The context-identifier is a number and is used in the protocol to link a data-package to a context-pointer. This is necessary because the communication interface is shared between the parent-context and the child-context. This number is unique.
[in] | ctx | the MqContextS instance to work on |
Definition at line 5263 of file LibMqMsgque_mq.h.
Non-inline replacement for MqLinkGetCtxId …
get the initial parent-context from a client/server link …
[in] | ctx | the MqContextS instance to work on |
MK_NULL
if ctx is MK_NULL
Definition at line 5234 of file LibMqMsgque_mq.h.
Non-inline replacement for MqLinkGetParent …
get the ident of the link-target …
This function is only useful if the link is up and running.
[in] | ctx | the MqContextS instance to work on |
MK_NULL
if not connected Definition at line 5274 of file LibMqMsgque_mq.h.
Non-inline replacement for MqLinkGetTargetIdent …
is the context connected? …
A context is connected if the MqLinkCreate command was successful. A context is not connected if:
[in] | ctx | the MqContextS instance to work on |
MK_YES
or MK_NO
|
inline |
is the context a parent-context? …
A context is a parent-context if it was created with MqLinkCreate
[in] | ctx | the MqContextS instance to work on |
MK_YES
or MK_NO
Definition at line 5250 of file LibMqMsgque_mq.h.
Non-inline replacement for MqLinkIsParent …
shutdown the communication with a server
The following tasks are performend:
[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 |