PGClient
Payment Gateway Client Library
|
Go to the source code of this file.
Macros | |
MacrosSec | |
Macros section | |
#define | PGC_HAS_ERR(nErr) ((nErr) < PGC_ERR_NONE_MARKER) |
#define | PGC_IS_ASYNC(nErr) ((nErr) == PGC_ERR_NONE_ASYNC) |
#define | PGC_ISVALID_CONN(nConn) ((nConn) > 0) |
#define | PGC_ISVALID_SESS(nSess) ((nSess) > 0) |
FuncDecoSec | |
Function decorators section | |
#define | PGC_DECL_EXPORT __attribute__ ((visibility("default"))) |
Export function decorator. | |
#define | PGC_DECL_IMPORT |
Import function decorator. | |
#define | PGC_API_EXPORT PGC_DECL_IMPORT |
API export function decorator. | |
#define | PGC_API_ENTRY |
API entry function decorator. | |
Functions | |
FuncInitSec | |
Init functions section | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcInit (const char *sMduName) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcUninit (const char *sMduName) |
FuncInfoSec | |
Info functions section | |
PGC_API_EXPORT const char *PGC_API_ENTRY | PgcGetVer () |
PGC_API_EXPORT void PGC_API_ENTRY | PgcGetErrTag (int nErrCode, char *sErrTag) |
PGC_API_EXPORT void PGC_API_ENTRY | PgcLogInfo (const char *sFmt, const char *sArg1, const char *sArg2, const char *sArg3) |
PGC_API_EXPORT void PGC_API_ENTRY | PgcLogErr (const char *sFmt, const char *sArg1, const char *sArg2, const char *sArg3) |
FuncConnSec | |
Connection functions section | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcNewConn (const char *sUrl, const char *sUName, const char *sPwd, int nTimeout, const char *sMduName, const char *sCfgPath) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcFreeConn (int nConn) |
PGC_API_EXPORT bool PGC_API_ENTRY | PgcIsSyncMode (int nConn) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetConnOpt (int nConn, const char *sKey, const char *sVal) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetConnSts (int nConn, const char *sKey, char *sVal, int nSize) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetConnProp (int nConn, const char *sSec, const char *sKey, const char *sVal) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetConnProp (int nConn, const char *sSec, const char *sKey, const char *sDefVal, char *sVal, int nSize) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcConnect (int nConn) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcDisconnect (int nConn) |
PGC_API_EXPORT bool PGC_API_ENTRY | PgcIsConnected (int nConn) |
FuncSessSec | |
Session functions section | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcNewSess (int nConn, int nMsgCnt) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcFreeSess (int nSess) |
PGC_API_EXPORT bool PGC_API_ENTRY | PgcIsRecvEnd (int nSess) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetSessOpt (int nSess, const char *sKey, const char *sVal) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetSessSts (int nSess, const char *sKey, char *sVal, int nSize) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetConn (int nSess, int nConn) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetConn (int nSess) |
FuncMsgBlockSec | |
Message block functions section | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetMsgCnt (int nSess) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetMsgData (int nSess, bool bIsRaw, const char *sVal) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetMsgData (int nSess, bool bIsRaw, char *sVal, int nSize) |
PGC_API_EXPORT bool PGC_API_ENTRY | PgcIsRawMsg (int nSess) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetMsgPrm (int nSess, const char *sKey, const char *sVal) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetMsgPrm (int nSess, const char *sKey, char *sVal, int nSize) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcNewMsg (int nSess) |
FuncMsgSec | |
Message functions section | |
PGC_API_EXPORT bool PGC_API_ENTRY | PgcIsSet (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcUnset (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT bool PGC_API_ENTRY | PgcIsEmpty (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetType (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetStr (int nSess, int nMsg, const char *sKey, const char *sVal) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetStr (int nSess, int nMsg, const char *sKey, char *sVal, int nSize) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetAmt (int nSess, int nMsg, const char *sKey, long nVal) |
PGC_API_EXPORT long PGC_API_ENTRY | PgcGetAmt (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetInt (int nSess, int nMsg, const char *sKey, int nVal) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetInt (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetNum (int nSess, int nMsg, const char *sKey, double nVal) |
PGC_API_EXPORT double PGC_API_ENTRY | PgcGetNum (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetBool (int nSess, int nMsg, const char *sKey, bool bVal) |
PGC_API_EXPORT bool PGC_API_ENTRY | PgcGetBool (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetDate (int nSess, int nMsg, const char *sKey, double dVal) |
PGC_API_EXPORT double PGC_API_ENTRY | PgcGetDate (int nSess, int nMsg, const char *sKey) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetChildMsg (int nSess, int nMsg, const char *sKey, int nChildMsgSess) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcGetChildMsg (int nSess, int nMsg, const char *sKey) |
FuncReqSec | |
Request functions section | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcRequest (int nSess) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSend (int nSess) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcPerform (int nSess) |
FuncHeedSec | |
Heed functions section | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcHeed (int nConn) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcUnheed (int nConn) |
PGC_API_EXPORT bool PGC_API_ENTRY | PgcIsHeeding (int nConn) |
PGC_API_EXPORT int PGC_API_ENTRY | PgcPoll (int nConn, int nTimeout) |
FuncCfmSec | |
Confirm functions section | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcConfirm (int nSess) |
FuncTxnSec | |
Transaction functions section | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcDoTxn (const char *sUrl, const char *sReq, char *sRsp, int nRspSize) |
FuncCbkSec | |
typedef int | nConn |
typedef int int | nSess |
typedef | int (PGC_API_ENTRY PGC_EVTCBK_FUNC)(void *pRef |
Event callback function. More... | |
PGC_API_EXPORT int PGC_API_ENTRY | PgcSetCbk (int nConn, PGC_EVTCBK_FUNC *pfnEvtCbk, void *pEvtCbkRef) |
Set callback. More... | |
Payment Gateway Client Header
Strings are all in UTF-8 encoding
Schemes and supported actions
WSS (Async): Request, Confirm, Send
WSS (Sync): Request
HTTPS (Sync): Request
#define PGC_HAS_ERR | ( | nErr | ) | ((nErr) < PGC_ERR_NONE_MARKER) |
Check if the error code contains an error
[in] | nErr | Error code |
#define PGC_IS_ASYNC | ( | nErr | ) | ((nErr) == PGC_ERR_NONE_ASYNC) |
Check if the error code is async
[in] | nErr | Error code |
#define PGC_ISVALID_CONN | ( | nConn | ) | ((nConn) > 0) |
Check if the connection value is valid
[in] | nConn | Connection |
#define PGC_ISVALID_SESS | ( | nSess | ) | ((nSess) > 0) |
Check if the session value is valid
[in] | nSess | Session |
enum PgcErrs |
Error codes.
enum PgcTypes |
enum PgcTimeoInds |
Timeout Indicators (used in the nTimeout field in NewConn function)
enum PgcMsgOpTgts |
PGC_API_EXPORT int PGC_API_ENTRY PgcInit | ( | const char * | sMduName | ) |
Initialize It has to be called in the main thread
[in] | sMduName | Module name |
PGC_API_EXPORT int PGC_API_ENTRY PgcUninit | ( | const char * | sMduName | ) |
Uninitialize
[in] | sMduName | Module name |
PGC_API_EXPORT const char* PGC_API_ENTRY PgcGetVer | ( | ) |
Get version
PGC_API_EXPORT void PGC_API_ENTRY PgcGetErrTag | ( | int | nErrCode, |
char * | sErrTag | ||
) |
Get error tag
[in] | nErrCode | Error code |
[out] | sErrTag | Error tag; The size must be equal to or greater than 256 |
PGC_API_EXPORT void PGC_API_ENTRY PgcLogInfo | ( | const char * | sFmt, |
const char * | sArg1, | ||
const char * | sArg2, | ||
const char * | sArg3 | ||
) |
Write to log at info level
[in] | sFmt | Format |
[in] | sArg1 | Argument 1 to be logged |
[in] | sArg2 | Argument 2 to be logged |
[in] | sArg3 | Argument 3 to be logged |
PGC_API_EXPORT void PGC_API_ENTRY PgcLogErr | ( | const char * | sFmt, |
const char * | sArg1, | ||
const char * | sArg2, | ||
const char * | sArg3 | ||
) |
Write to log at error level
[in] | sFmt | Format |
[in] | sArg1 | Argument 1 to be logged |
[in] | sArg2 | Argument 2 to be logged |
[in] | sArg3 | Argument 3 to be logged |
PGC_API_EXPORT int PGC_API_ENTRY PgcNewConn | ( | const char * | sUrl, |
const char * | sUName, | ||
const char * | sPwd, | ||
int | nTimeout, | ||
const char * | sMduName, | ||
const char * | sCfgPath | ||
) |
Create new connection
[in] | sUrl | URL to connect to; Accepted forms: "wss://host:port/path", "https://host:port/path", or "$Service"; if empty, get from: cfg file in curr dir, cfg file in def dir |
[in] | sUName | Name that can uniquely identify the client; if empty, get from: env var, cfg file in curr dir, cfg file in def dir, random name |
[in] | sPwd | Password to connect to the server; if empty, get from: cfg file in curr dir, cfg file in def dir |
[in] | nTimeout | Timeout indicator or actual timeout in milliseconds; if zero, get from: cfg file in curr dir, cfg file in def dir |
[in] | sMduName | Module name; if empty, get from: random name |
[in] | sCfgPath | Configuration directory or file; if file path, use it; if dir path, locate cfg file; if empty, use curr dir; if not in curr dir, use def dir; any file matching prefix and extension in the cfg dir; if file name has matching UName, choose this |
PGC_API_EXPORT int PGC_API_ENTRY PgcFreeConn | ( | int | nConn | ) |
Close connection
[in] | nConn | Connection |
PGC_API_EXPORT bool PGC_API_ENTRY PgcIsSyncMode | ( | int | nConn | ) |
Is connection synchronous mode (non-async mode)
[in] | nConn | Connection |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetConnOpt | ( | int | nConn, |
const char * | sKey, | ||
const char * | sVal | ||
) |
Set connection option
[in] | nConn | Connection |
[in] | sKey | Key for the option |
[in] | sVal | Value for the option |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetConnSts | ( | int | nConn, |
const char * | sKey, | ||
char * | sVal, | ||
int | nSize | ||
) |
Get connection status / stat
[in] | nConn | Connection |
[in] | sKey | Key of the status / stat |
[out] | sVal | Value buffer for the status / stat |
[in] | nSize | Size of the value buffer |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetConnProp | ( | int | nConn, |
const char * | sSec, | ||
const char * | sKey, | ||
const char * | sVal | ||
) |
Set connection property
[in] | nConn | Connection |
[in] | sSec | Section of the property |
[in] | sKey | Key of the property |
[in] | sVal | Value buffer for the property |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetConnProp | ( | int | nConn, |
const char * | sSec, | ||
const char * | sKey, | ||
const char * | sDefVal, | ||
char * | sVal, | ||
int | nSize | ||
) |
Get connection property
[in] | nConn | Connection |
[in] | sSec | Section of the property |
[in] | sKey | Key of the property |
[in] | sDefVal | Default value of the property |
[out] | sVal | Value buffer for the property |
[in] | nSize | Size of the value buffer |
PGC_API_EXPORT int PGC_API_ENTRY PgcConnect | ( | int | nConn | ) |
Connect
[in] | nConn | Connection |
PGC_API_EXPORT int PGC_API_ENTRY PgcDisconnect | ( | int | nConn | ) |
Disconnect
[in] | nConn | Connection |
PGC_API_EXPORT bool PGC_API_ENTRY PgcIsConnected | ( | int | nConn | ) |
Is connected
[in] | nConn | Connection |
PGC_API_EXPORT int PGC_API_ENTRY PgcNewSess | ( | int | nConn, |
int | nMsgCnt | ||
) |
Create new session
[in] | nConn | Connection |
[in] | nMsgCnt | Message operation target or the actual message count |
PGC_API_EXPORT int PGC_API_ENTRY PgcFreeSess | ( | int | nSess | ) |
Close session
[in] | nSess | Session |
PGC_API_EXPORT bool PGC_API_ENTRY PgcIsRecvEnd | ( | int | nSess | ) |
Is session a receiving party
[in] | nSess | Session |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetSessOpt | ( | int | nSess, |
const char * | sKey, | ||
const char * | sVal | ||
) |
Set session option
[in] | nSess | Session |
[in] | sKey | Key for the option |
[in] | sVal | Value for the option |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetSessSts | ( | int | nSess, |
const char * | sKey, | ||
char * | sVal, | ||
int | nSize | ||
) |
Get session status / stat
[in] | nSess | Session |
[in] | sKey | Key of the status / stat |
[out] | sVal | Value buffer for the status / stat |
[in] | nSize | Size of the value buffer |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetConn | ( | int | nSess, |
int | nConn | ||
) |
Set connection to session
[in] | nSess | Session |
[in] | nConn | Connection |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetConn | ( | int | nSess | ) |
Get connection from session
[in] | nSess | Session |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetMsgCnt | ( | int | nSess | ) |
Get message count
[in] | nSess | Session |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetMsgData | ( | int | nSess, |
bool | bIsRaw, | ||
const char * | sVal | ||
) |
[in] | nSess | Session |
[in] | bIsRaw | if the data is raw data (not JSON) |
[in] | sVal | Value of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetMsgData | ( | int | nSess, |
bool | bIsRaw, | ||
char * | sVal, | ||
int | nSize | ||
) |
[in] | nSess | Session |
[in] | bIsRaw | if the data is raw data (not JSON) |
[out] | sVal | Value of the data |
[in] | nSize | Size of the sVal buffer |
PGC_API_EXPORT bool PGC_API_ENTRY PgcIsRawMsg | ( | int | nSess | ) |
[in] | nSess | Session |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetMsgPrm | ( | int | nSess, |
const char * | sKey, | ||
const char * | sVal | ||
) |
Set message parameter
[in] | nSess | Session |
[in] | sKey | Key of the data |
[in] | sVal | Value of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetMsgPrm | ( | int | nSess, |
const char * | sKey, | ||
char * | sVal, | ||
int | nSize | ||
) |
Get message parameter
[in] | nSess | Session |
[in] | sKey | Key of the data |
[out] | sVal | Value of the data |
[in] | nSize | Size of the sVal buffer |
PGC_API_EXPORT int PGC_API_ENTRY PgcNewMsg | ( | int | nSess | ) |
Create new message for confirm or reply The old message is backed up and can be accessed using negative message indexes
[in] | nSess | Session |
PGC_API_EXPORT bool PGC_API_ENTRY PgcIsSet | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Is key set in message
[in] | nSess | Session |
[in] | nMsg | Message index: starts with 0 for current messages; use negative numbers for the messages that were just backed up |
[in] | sKey | Key of the data; Accepted forms: Pointer style keys: /RootObj/SubObj/ArrIdx/Key |
PGC_API_EXPORT int PGC_API_ENTRY PgcUnset | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Unset key in message
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
PGC_API_EXPORT bool PGC_API_ENTRY PgcIsEmpty | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Is value empty in message
[in] | nSess | Session |
[in] | nMsg | Message index: starts with 0 for current messages; use negative numbers for the messages that were just backed up |
[in] | sKey | Key of the data; Accepted forms: Pointer style keys: /RootObj/SubObj/ArrIdx/Key |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetType | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Get type of value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetStr | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey, | ||
const char * | sVal | ||
) |
Set string value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
[in] | sVal | Value of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetStr | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey, | ||
char * | sVal, | ||
int | nSize | ||
) |
Get string value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
[out] | sVal | Value of the data |
[in] | nSize | Size of the sVal buffer |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetAmt | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey, | ||
long | nVal | ||
) |
Set amount value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
[in] | nVal | Value of the data; 2 decimal places assumed |
PGC_API_EXPORT long PGC_API_ENTRY PgcGetAmt | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Get amount value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetInt | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey, | ||
int | nVal | ||
) |
Set integer value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
[in] | nVal | Value of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetInt | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Get integer value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetNum | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey, | ||
double | nVal | ||
) |
Set number value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
[in] | nVal | Value of the data |
PGC_API_EXPORT double PGC_API_ENTRY PgcGetNum | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Get number value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetBool | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey, | ||
bool | bVal | ||
) |
Set boolean value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
[in] | bVal | Value of the data |
PGC_API_EXPORT bool PGC_API_ENTRY PgcGetBool | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Get boolean value
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetDate | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey, | ||
double | dVal | ||
) |
Set date/time value defined as seconds since 00:00, Jan 1, 1970 UTC
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
[in] | dVal | Value of the data; floating-point time_t |
PGC_API_EXPORT double PGC_API_ENTRY PgcGetDate | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Get date/time value defined as seconds since 00:00, Jan 1, 1970 UTC
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetChildMsg | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey, | ||
int | nChildMsgSess | ||
) |
Set child message in a session; a message (encoded) within the message
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
[in] | nChildMsgSess | Session that contains the child message |
PGC_API_EXPORT int PGC_API_ENTRY PgcGetChildMsg | ( | int | nSess, |
int | nMsg, | ||
const char * | sKey | ||
) |
Get child message in a session; a message (encoded) within the message
[in] | nSess | Session |
[in] | nMsg | Message index |
[in] | sKey | Key of the data |
PGC_API_EXPORT int PGC_API_ENTRY PgcRequest | ( | int | nSess | ) |
Request
[in] | nSess | Session |
PGC_API_EXPORT int PGC_API_ENTRY PgcSend | ( | int | nSess | ) |
Send message (from client, either initiate or respond)
[in] | nSess | Session |
PGC_API_EXPORT int PGC_API_ENTRY PgcPerform | ( | int | nSess | ) |
Perform task (from client)
[in] | nSess | Session |
typedef int | ( | PGC_API_ENTRY | PGC_EVTCBK_FUNC | ) |
Event callback function.
Example: int PGC_API_ENTRY PgcCallback(void * pRef, int nConn, int nSess);
PGC_EVTCBK_FUNC | Event callback function |
PGC_API_EXPORT int PGC_API_ENTRY PgcSetCbk | ( | int | nConn, |
PGC_EVTCBK_FUNC * | pfnEvtCbk, | ||
void * | pEvtCbkRef | ||
) |
Set callback.
To manually check the messages, make pfnEvtCbk and pEvtCbkRef NULL
[in] | nConn | Connection |
[in] | pfnEvtCbk | Event callback function |
[in] | pEvtCbkRef | Reference pointer when calling back |
PGC_API_EXPORT int PGC_API_ENTRY PgcHeed | ( | int | nConn | ) |
Heed (only valid for WSS)
[in] | nConn | Connection |
PGC_API_EXPORT int PGC_API_ENTRY PgcUnheed | ( | int | nConn | ) |
Unheed
[in] | nConn | Connection |
PGC_API_EXPORT bool PGC_API_ENTRY PgcIsHeeding | ( | int | nConn | ) |
Is heeding
[in] | nConn | Connection |
PGC_API_EXPORT int PGC_API_ENTRY PgcPoll | ( | int | nConn, |
int | nTimeout | ||
) |
Poll
[in] | nConn | Connection |
[in] | nTimeout | Timeout waiting for the message; 0 means no wait. |
PGC_API_EXPORT int PGC_API_ENTRY PgcConfirm | ( | int | nSess | ) |
Confirm
[in] | nSess | Session |
PGC_API_EXPORT int PGC_API_ENTRY PgcDoTxn | ( | const char * | sUrl, |
const char * | sReq, | ||
char * | sRsp, | ||
int | nRspSize | ||
) |
Do transaction
[in] | sUrl | URL to connect to; Accepted forms: "wss://host:port/", "https://host:port/", or "$Service" |
[in] | sReq | Request string in JSON format |
[out] | sRsp | Response string in JSON format |
[in] | nRspSize | Response buffer size |