Loading...
Searching...
No Matches
MqContextC_Link_CC_API

MqContextC - setup and manage a client-server-linkMore...

+ Collaboration diagram for MqContextC_Link_CC_API:

Functions

MqContextCccmqmsgque::MqContextC::LinkGetParent ()
  C++: MqContextC* ctx.LinkGetParent() C-API
get the initial parent-context from a client/server link …
 
void ccmqmsgque::MqContextC::LinkConnect ()
  C++: ctx.LinkConnect() C-API
re-connect a client-server-link after a server crash or a network downtime …
 
void ccmqmsgque::MqContextC::LinkCreate (MkBufferListC *args=NULL)
  C++: ctx.LinkCreate(MkBufferListC* args = NULL) C-API
make ctx to a parent-context and setup a new client-server-link
 
void ccmqmsgque::MqContextC::LinkCreate (const MkBufferListC &args)
  C++: ctx.LinkCreate(MkBufferListC* args = NULL) C-API
make ctx to a parent-context and setup a new client-server-link
 
void ccmqmsgque::MqContextC::LinkCreateChild (MqContextC *parent, MkBufferListC *args=NULL)
  C++: ctx.LinkCreateChild(MqContextC* parent, MkBufferListC* args = NULL) C-API
make a context to a child-context on-top of an existing parent-client-server-link
 
void ccmqmsgque::MqContextC::LinkCreateChild (const MqContextC &parent, const MkBufferListC &args)
  C++: ctx.LinkCreateChild(MqContextC* parent, MkBufferListC* args = NULL) C-API
make a context to a child-context on-top of an existing parent-client-server-link
 
void ccmqmsgque::MqContextC::LinkDelete ()
  C++: ctx.LinkDelete() C-API
close the client-server-link
 
MK_NUM ccmqmsgque::MqContextC::LinkGetCtxId ()
  C++: MK_NUM ctx.LinkGetCtxId() C-API
get an identifier which is unique per parent-or-child-context
 
MK_STRN ccmqmsgque::MqContextC::LinkGetTargetIdent ()
  C++: MK_STRN ctx.LinkGetTargetIdent() C-API
get the ident of the link-target
 
MK_BOOL ccmqmsgque::MqContextC::LinkIsConnected ()
  C++: MK_BOOL ctx.LinkIsConnected() C-API
is the context connected? …
 
MK_BOOL ccmqmsgque::MqContextC::LinkIsParent ()
  C++: MK_BOOL ctx.LinkIsParent() C-API
is the context a parent-context? …
 
void ccmqmsgque::MqContextC::LinkShutdown ()
  C++: ctx.LinkShutdown() C-API
shutdown the communication with a server
 
void ccmqmsgque::MqContextC::LinkCheckOptionI32 (MK_STRN opt, MK_I32 *val)
  C++: ctx.LinkCreate(MkBufferListC* args = NULL) C-API
make ctx to a parent-context and setup a new client-server-link
 

Detailed Description

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"

client --tcp --host REMOTE_HOST --port REMOTE_PORT ... or
client --uds --file MYFILE ...

Definition of a "parent-context"

Definition of a "child-context"

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"

client --tcp --host REMOTE_HOST --port REMOTE_PORT ... or
client --uds --file MYFILE ...

Definition of a "parent-context"

Definition of a "child-context"

Function Documentation

◆ LinkCheckOptionI32()

void ccmqmsgque::MqContextC::LinkCheckOptionI32 ( MK_STRN opt,
MK_I32 * val )

C++: ctx.LinkCreate(MkBufferListC* args = NULL) C-API
make ctx to a parent-context and setup a new client-server-link

C++: ctx.LinkCreateChild(MqContextC* parent, MkBufferListC* args = NULL) C-API
make a context to a child-context on-top of an existing parent-client-server-link

Definition at line 171 of file LibMqMsgque_cc.cc.

171 {
173 ErrorCheck (MkBufferListCheckOptionI32 (reinterpret_cast<MQ_CTX>(hdl)->link.alfa, opt, 0, true, val));
174 }
#define MkBufferListCheckOptionI32(...)
void ErrorCheck(enum MkErrorE err, MK_STRN const caller=__builtin_FUNCTION(), MK_I32 const line=__builtin_LINE()) const
#define MkRtSetup_NULL
struct MqContextS * MQ_CTX
class-shortcut for struct MqContextS *, all shortcut using the XX_YYY syntax (only for public API) …
+ Here is the caller graph for this function:

◆ LinkConnect()

void ccmqmsgque::MqContextC::LinkConnect ( )
inline

C++: ctx.LinkConnect() C-API
re-connect a client-server-link after a server crash or a network downtime …

Definition at line 838 of file MqContextC_inline_cc.hh.

838 {
839 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
840 MkRtSetup_X(ctx);
841 enum MkErrorE errVal = MqLinkConnect(ctx);
842 MkErrorC_Check(ctx, errVal);
843 }
#define MK_NULL_NO
#define MK_UNUSED
#define MkRtSetup_X(x)
MQ_CTX getCTX(bool nullB=MK_NULL_NO) const
return the LibMsgqueObject from current MqContextC instance

◆ LinkCreate() [1/2]

void ccmqmsgque::MqContextC::LinkCreate ( const MkBufferListC & args)
inline

C++: ctx.LinkCreate(MkBufferListC* args = NULL) C-API
make ctx to a parent-context and setup a new client-server-link

Definition at line 855 of file MqContextC_inline_cc.hh.

855 {
856 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
857 MkRtSetup_X(ctx);
858 const MK_BAC args_hdl = MkBufferListC::getBFL(args,MK_NULL_NO);
859 enum MkErrorE errVal = MqLinkCreate(ctx, args_hdl);
860 MkErrorC_Check(ctx, errVal);
861 }
MK_BFL getBFL(bool nullB=MK_NULL_NO) const
struct MkBufferListS * MK_BAC

◆ LinkCreate() [2/2]

void ccmqmsgque::MqContextC::LinkCreate ( MkBufferListC * args = NULL)
inline

C++: ctx.LinkCreate(MkBufferListC* args = NULL) C-API
make ctx to a parent-context and setup a new client-server-link

Definition at line 846 of file MqContextC_inline_cc.hh.

846 {
847 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
848 MkRtSetup_X(ctx);
850 enum MkErrorE errVal = MqLinkCreate(ctx, args_hdl);
851 MkErrorC_Check(ctx, errVal);
852 }
#define MK_NULL_YES
+ Here is the caller graph for this function:

◆ LinkCreateChild() [1/2]

void ccmqmsgque::MqContextC::LinkCreateChild ( const MqContextC & parent,
const MkBufferListC & args )
inline

C++: ctx.LinkCreateChild(MqContextC* parent, MkBufferListC* args = NULL) C-API
make a context to a child-context on-top of an existing parent-client-server-link

Definition at line 874 of file MqContextC_inline_cc.hh.

874 {
875 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
876 MkRtSetup_X(ctx);
877 const MQ_CTX parent_hdl = MqContextC::getCTX(parent,MK_NULL_NO);
878 const MK_BAC args_hdl = MkBufferListC::getBFL(args,MK_NULL_NO);
879 enum MkErrorE errVal = MqLinkCreateChild(ctx, parent_hdl, args_hdl);
880 MkErrorC_Check(ctx, errVal);
881 }

◆ LinkCreateChild() [2/2]

void ccmqmsgque::MqContextC::LinkCreateChild ( MqContextC * parent,
MkBufferListC * args = NULL )
inline

C++: ctx.LinkCreateChild(MqContextC* parent, MkBufferListC* args = NULL) C-API
make a context to a child-context on-top of an existing parent-client-server-link

Definition at line 864 of file MqContextC_inline_cc.hh.

864 {
865 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
866 MkRtSetup_X(ctx);
867 MQ_CTX parent_hdl = MqContextC::getCTX(parent,MK_NULL_NO);
869 enum MkErrorE errVal = MqLinkCreateChild(ctx, parent_hdl, args_hdl);
870 MkErrorC_Check(ctx, errVal);
871 }

◆ LinkDelete()

void ccmqmsgque::MqContextC::LinkDelete ( )
inline

C++: ctx.LinkDelete() C-API
close the client-server-link

Definition at line 884 of file MqContextC_inline_cc.hh.

884 {
885 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
886 MkRtSetup_X(ctx);
887 MqLinkDelete(ctx);
888 }

◆ LinkGetCtxId()

MK_NUM ccmqmsgque::MqContextC::LinkGetCtxId ( )
inline

C++: MK_NUM ctx.LinkGetCtxId() C-API
get an identifier which is unique per parent-or-child-context

Definition at line 891 of file MqContextC_inline_cc.hh.

891 {
892 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
893 MkRtSetup_X(ctx);
894 MK_NUM __retVal__L = MqLinkGetCtxId(ctx);
895 return __retVal__L;
896 }
int32_t MK_NUM

◆ LinkGetParent()

MqContextC * ccmqmsgque::MqContextC::LinkGetParent ( )
inline

C++: MqContextC* ctx.LinkGetParent() C-API
get the initial parent-context from a client/server link …

Definition at line 828 of file MqContextC_inline_cc.hh.

828 {
829 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
830 MkRtSetup_X(ctx);
831 MQ_CTX __retVal__L = MqLinkGetParent(ctx);
832 return MqContextC::MqContextC_ObjNew(MK_RT_CALL __retVal__L);
833 }
#define MK_RT_CALL
static MqContextC * MqContextC_ObjNew(MK_RT const mkrt, MQ_CTX hdl)
return MqContextC from LibMsgqueObject

◆ LinkGetTargetIdent()

MK_STRN ccmqmsgque::MqContextC::LinkGetTargetIdent ( )
inline

C++: MK_STRN ctx.LinkGetTargetIdent() C-API
get the ident of the link-target

Definition at line 899 of file MqContextC_inline_cc.hh.

899 {
900 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
901 MkRtSetup_X(ctx);
902 MK_STRN __retVal__L = MqLinkGetTargetIdent(ctx);
903 return __retVal__L;
904 }
const MK_STRB * MK_STRN

◆ LinkIsConnected()

MK_BOOL ccmqmsgque::MqContextC::LinkIsConnected ( )
inline

C++: MK_BOOL ctx.LinkIsConnected() C-API
is the context connected? …

Definition at line 907 of file MqContextC_inline_cc.hh.

907 {
908 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
909 MkRtSetup_X(ctx);
910 MK_BOOL __retVal__L = MqLinkIsConnected(ctx);
911 return __retVal__L;
912 }

◆ LinkIsParent()

MK_BOOL ccmqmsgque::MqContextC::LinkIsParent ( )
inline

C++: MK_BOOL ctx.LinkIsParent() C-API
is the context a parent-context? …

Definition at line 915 of file MqContextC_inline_cc.hh.

915 {
916 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
917 MkRtSetup_X(ctx);
918 MK_BOOL __retVal__L = MqLinkIsParent(ctx);
919 return __retVal__L;
920 }

◆ LinkShutdown()

void ccmqmsgque::MqContextC::LinkShutdown ( )
inline

C++: ctx.LinkShutdown() C-API
shutdown the communication with a server

Definition at line 923 of file MqContextC_inline_cc.hh.

923 {
924 MK_UNUSED auto ctx = getCTX(MK_NULL_NO);
925 MkRtSetup_X(ctx);
926 enum MkErrorE errVal = MqLinkShutdown(ctx);
927 MkErrorC_Check(ctx, errVal);
928 }