2#include "MidLinkBase.h"
5#include "unBaseFunction.h"
6#include "mdwclient_global.h"
49 class MDWC_COMPLILE CMidLinkComm
53 PCharSetConvert m_ToCommunityCharSet;
55 PCharSetConvert m_ToAppCharSet;
67 std::string m_sLastErrorMsg;
69 bool m_bIsUseRouteConnected;
71 bool m_bIsDisabledTimeOut;
74 CMidLinkComm(
const CMidLinkComm&) =
delete;
76 CMidLinkComm& operator=(
const CMidLinkComm&) =
delete;
182 int CreateConnect(
const std::string& sIPAdress,
unsigned short iCommPort,
int iTimeOut,
const std::string& sTokenID =
"");
276 int SendDataPack(
int iReqNo,
const std::string& sMsg,
bool bNewRequest,
unsigned char uRouteID = 0,
bool bUseBinData =
false);
286 bool SendDataPacks(
int iReqNo,
const std::vector<std::string>& sDataPack,
unsigned char iRouteID = 0);
298 int SendBinData(
int iReqNo,
const unsigned char* cReqData,
int iDataLen,
bool bNewReq,
unsigned char uRouteID = 0);
334 bool GetResponseData(
bool* bNext,
char *cDataBuf,
unsigned int& iBufLen);
bool GetResponseResult(bool *bNext, char *cDataBuf, unsigned int &iBufLen)
定义 MidLinkComm.cpp:744
unsigned char m_uPackType
定义 MidLinkComm.h:81
bool IsConnected()
当前通信连接是否正常
定义 MidLinkComm.cpp:399
int CancelRequest(CANCEL_TYPE ctOperate=CANCEL_TYPE::ctClearSocket)
取消功能请求执行
定义 MidLinkComm.cpp:667
uint32_t GetFieldUIntValue(int iFieldNo)
取得指定整数数据项的值
定义 MidLinkComm.cpp:1017
void SetLocalCharSet()
设置通信连接字符集,并初始化字符集转换函数
定义 MidLinkComm.cpp:129
bool IsUseRouteConnected()
检查本连接是否通过路由网络连接中间件服务器
定义 MidLinkComm.cpp:472
uint64_t GetFieldUInt64Value(int iFieldNo)
取得指定64位整数数据项的值
定义 MidLinkComm.cpp:1065
double GetFieldDoubleValue(int iFieldNo)
取得指定双精度浮点数据项的值
定义 MidLinkComm.cpp:1113
bool CheckIsUseRouteConnected()
判断是否使用路由连接
定义 MidLinkComm.cpp:162
std::vector< unsigned char > GetFieldBinValue(int iFieldNo)
取得指定二进制数据项的值
定义 MidLinkComm.cpp:977
RESULT_TYPE ResponeDataType()
取各响应数据结果类型
定义 MidLinkComm.cpp:179
void ContinueReceiveData()
强制继续接收数据,只改变内部状态
定义 MidLinkComm.cpp:466
int CreateConnect()
定义 MidLinkComm.cpp:190
bool DidabledTimeOutStatus()
当前连接是否启用禁止连接超时
定义 MidLinkComm.cpp:405
int GetCommKey()
取得当前通信加密Key
定义 MidLinkComm.cpp:411
std::string ToCommunityCharSet(const char *str)
定义 MidLinkComm.cpp:1190
std::string GetLocalIntenetAddress()
定义 MidLinkComm.cpp:451
void CloseConnect()
关闭通信连接后
定义 MidLinkComm.cpp:371
float GetFieldFloatValue(int iFieldNo)
取得指定单精度浮点数据项的值
定义 MidLinkComm.cpp:1089
MIDServerInfo m_MidServerInfo
定义 MidLinkComm.h:85
int SendDataPack(int iReqNo, const std::string &sMsg, bool bNewRequest, unsigned char uRouteID=0, bool bUseBinData=false)
发送数据库业务功能请求数据
定义 MidLinkComm.cpp:478
int GetMBSIntDataItem(const char *uSou, int iPos)
从中间件返回数据中取得整数数据
定义 MidLinkComm.cpp:95
int GetLastExecFunNo()
定义 MidLinkComm.h:459
bool SendDataPacks(int iReqNo, const std::vector< std::string > &sDataPack, unsigned char iRouteID=0)
发送多行数据,对应中间件RECEIVEPACKS指令
定义 MidLinkComm.cpp:525
std::string GetLastErrorMessage()
取得最后执行的错误信息
定义 MidLinkComm.cpp:1161
std::string GetMBSDataItem(const char *uSou, int iPos)
从中间件返回数据中取得数据
定义 MidLinkComm.cpp:78
int64_t GetFieldInt64Value(int iFieldNo)
取得指定64位整数数据项的值
定义 MidLinkComm.cpp:1041
MIDServerInfo GetMidServerInfo(int iConnectNo)
取得服务器功能信息
定义 MidLinkComm.cpp:297
void SetLastErrorMessage(const std::string &sMsg)
设置最后执行的错误信息
定义 MidLinkComm.cpp:1173
void RequestFinshed()
功能请求完成
定义 MidLinkComm.cpp:954
int ClearAndWaitAnswerData(const std::string &sWaitText="")
清除接收缓存区所数据,直到收到指定的内容
定义 MidLinkComm.cpp:704
std::vector< std::string > m_SResults
定义 MidLinkComm.h:89
void SetResponseResultType(unsigned char uPackType)
设置返回结果类型
定义 MidLinkComm.cpp:145
int GetFieldIntValue(int iFieldNo)
取得指定整数数据项的值
定义 MidLinkComm.cpp:993
long double GetFieldDecimalValue(int iFieldNo)
取得指定十进制数据项的值
定义 MidLinkComm.cpp:1137
void SetRouteNode(unsigned char uNodeNo)
将本通信连接的所有数据直接路由转发到指定的通信接点
定义 MidLinkComm.cpp:247
int GetConnectStatus(std::string &sConnectStatus)
取得当前通信连接的状态
定义 MidLinkComm.cpp:417
int64_t GetMBSInt64DataItem(const char *uSou, int iPos)
从中间件返回数据中取得64位整数数据
定义 MidLinkComm.cpp:112
void DisabledTimeOut()
禁止通信超时
定义 MidLinkComm.cpp:230
static std::string CheckParaBySQL(const std::string &sPara)
检查字符串是否符SQL语法有冲突,并纠正
定义 MidLinkComm.cpp:36
int SendBinData(int iReqNo, const unsigned char *cReqData, int iDataLen, bool bNewReq, unsigned char uRouteID=0)
发送二进制数据
定义 MidLinkComm.cpp:610
int m_iLinkNo
定义 MidLinkComm.h:79
RESULT_TYPE m_rtResponse
定义 MidLinkComm.h:83
MidCharSet m_eCommCharSet
定义 MidLinkComm.h:87
std::string m_LastCallMethodName
定义 MidLinkComm.h:91
bool MidCommBusy()
检查当前通信连接是否被占用
定义 MidLinkComm.cpp:435
bool GetResponseData(bool *bNext, char *cDataBuf, unsigned int &iBufLen)
定义 MidLinkComm.cpp:834
std::string GetFieldValue(int iFieldNo)
取得指定字符类型数据项的值
定义 MidLinkComm.cpp:961
std::string ToAppCharsetString(const char *str)
转换为应用程序字符集
定义 MidLinkComm.cpp:1179
bool MidLinkIsInited()
中间件通信库是否完成初始化
定义 MidLinkComm.cpp:381
void EnabledTimeOut()
允许通信超时
定义 MidLinkComm.cpp:238
int GetLastErrorCode()
取得最后执行错误代码
定义 MidLinkComm.cpp:1167
MidCharSet
定义 MDWPack.h:86
CANCEL_TYPE
定义 MidLinkComm.h:39
@ ctBreakBussiness
定义 MidLinkComm.h:43
@ ctClearSocket
定义 MidLinkComm.h:41
@ ctBreakAndClose
定义 MidLinkComm.h:45
const std::string READY_TO_RECEIVE
定义 MidLinkComm.h:11
RESULT_TYPE
定义 MidLinkComm.h:17
@ rtDataSetRow
定义 MidLinkComm.h:25
@ rtDataSetRowBin
定义 MidLinkComm.h:32
@ rtDataSetHead
定义 MidLinkComm.h:23
@ rtNormal
定义 MidLinkComm.h:19
@ rtDBPara
定义 MidLinkComm.h:27
@ rtBin
定义 MidLinkComm.h:21