Mulitplexing API
This API hides the details of mutiplexing over message queues. It has a very simple interface which is very similar to the Tuxedo atmi api on both the client and the server (no transactions support however ;) ). Has both sync and async abilities. Server code is incredibly simple. Includes an administration process to cleanup if processes abort without first releasing handles. Client side is essentially thread safe. Only one thread at a time can operate on a single handle however. There is no limitation to the number of handles that a process can create, hence each thread can have its own handle. Handles don't have thread affinity, just not designed to have multiple threads use a handle similtaniously. When I get time I will create my own queue class so that it will be independant of Unix message queues and on Windows COMify it. C interface only currently. Tested on Solaris and SCO.

Here is a brief look at the API (see
mpx.h for more detail)

Client side

CHANDLE initCMP(char *serverClass);
int changeServerClassCMP(CHANDLE handle, char *serverClass);
int callCMP(CHANDLE handle, char *serviceName, char *idata, long ilen,
char **odata, long *olen, long flags);
int asyncCallCMP(CHANDLE handle, char *serviceName, char *idata, long ilen,
long flags);
int getReplyCMP(CHANDLE handle, int *callToken, char **data, long *len,
long flags);
void termCMP(CHANDLE handle);
long getLastErrorCMP(CHANDLE handle);
void enableTimeoutsCMP();
void disableTimeoutsCMP();

Server side

typedef struct smpCALLINFO
char serviceName[32];
char *data;
long dataLength;
long flags;
typedef void (*SMPSERVICE)(SMPCALLINFO *);
int runSMP(char *serverClass, SMPSERVICE service);
void returnSMP(long returnValue,
long resultCode,
char *data,
long length,
long flags);

Buffer routines

char *allocBufferMPX(char *bufferType, char *bufferSubtype, long length);
char *reallocBufferMPX(char *buffer, long length);
char *dupBufferMPX(char *buffer);
void freeBufferMPX(char *buffer);
char *getBufferTypeMPX(char *buffer);
char *getBufferSubtypeMPX(char *buffer);

MPXAPI User Guide for more information.