![]() |
C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
|
#include <MidLinkBase.h>
Public 成员函数 | |
| std::string | GetMachineID () |
| bool | Inited () |
| int | GetConnectStatus (std::string &sConnectStatus) |
| bool | GetConnectServerInfo (MIDServerInfo &sInfo) |
| MidLinkBase () | |
| ~MidLinkBase () | |
| int | GetTxmmKey () |
| bool | OpenMidLinkComm (const std::string &sIPAdress, int iCommPort, int iTimeOut, const std::string &sTokenID="") |
| bool | OpenMidLinkComm (const std::string &sConfigFile="", bool bConnectedServer=true) |
| bool | SetCommCharSet (MidCharSet eCharSetID) |
| void | RecycleMidLinkComm (int iFreeTime) |
| std::vector< std::string > | GetMidLinkCommPoolStatus () |
| CMidLinkComm * | GetMidLinkComm (const std::string &sOperate) |
| CMidLinkComm * | GetMidLinkComm (const std::string &sOperate, const std::string &sIPAdress, short iCommPort, int iTimeOut=30, const std::string &sTokenID="") |
| void | ReleaseMidLinkComm (mdwc::CMidLinkComm *comm, bool bRemove=false) |
| void | CloseMidLinkComm (bool bReleaseComm) |
| int | RegisterUser (std::string UserCode, std::string UserName) |
| int | UnRegisterUser () |
| int | RegisterRDMS (int iConnectNo, std::string sClientID, unsigned short wPort, bool bLogOut, bool bPMPMode) |
| bool | SendNetMessage (mdwc::MSG_TYPE eMsgType, std::string sMsgContext) |
| int | SendTextMessage (std::string sReceives, std::string sMsgContext, std::string sSended) |
| std::vector< mdwc::Logon_UserInfo > | GetClientLoginInfo () |
| int | GetShowedMessage (mdwc::NET_MESSAGE &retmsg) |
| std::string | GetLocalMACAddres () |
| bool | ReceiveMulticastFile (bool bEnabled, const std::string &sFileType="*") |
| std::string | Encrypt10Char (const std::string &sSou, int iPinKey) |
| std::string | Encrypt (const std::string &sSou, int iPinKey) |
| std::string | Decrypt10Char (const std::string &sSou, int iPinKey) |
| std::string | Decrypt (const std::string &sSou, int iPinKey) |
静态 Public 成员函数 | |
| static mdwc::MidLinkBase * | Initialize (const std::string &sProductName, const std::string &sVersion, const std::string &sWorkDirectory="", MidCharSet eDefaultChatSet=MidCharSet::AUTO, int iAutoRecycleCommObjectWaitTimes=120) |
| static void | UnInitialize () |
| static std::string | GetLastErrorMessage () |
Public 属性 | |
| std::unique_ptr< CMidLinkDLL > | MidLinkDLL |
| std::unique_ptr< CMDWLogger > | MDWLogger |
| std::unique_ptr< CRDMSLogHelper > | RDMSLogHelper |
| std::unique_ptr< CMidLinkMessage > | MidLinkMessage |
| std::unique_ptr< CMidLinkServer > | MidLinkServer |
通信连接库基类,提供初始化,获取通信连接,释放连接等基础功能
| mdwc::MidLinkBase::MidLinkBase | ( | ) |
构造函数

| mdwc::MidLinkBase::~MidLinkBase | ( | ) |
析构函数

| void mdwc::MidLinkBase::CloseMidLinkComm | ( | bool | bReleaseComm | ) |
关闭通信接口,释放连接资源,应用程序退出时调用。
| bReleaseComm | 是否释放通信连接库 |

| std::string mdwc::MidLinkBase::Decrypt | ( | const std::string & | sSou, |
| int | iPinKey ) |
不定长解密函数
| sSou | 加密的密码字符 |
| iPinKey | 加密Key |
| std::string mdwc::MidLinkBase::Decrypt10Char | ( | const std::string & | sSou, |
| int | iPinKey ) |
定长解密函数,10位字符密码
| sSou | 20位加密的密码字符 |
| iPinKey | 加密Key |
| std::string mdwc::MidLinkBase::Encrypt | ( | const std::string & | sSou, |
| int | iPinKey ) |
不定长加密函数
| sSou | 长度不限制 |
| iPinKey | 加密Key |
| std::string mdwc::MidLinkBase::Encrypt10Char | ( | const std::string & | sSou, |
| int | iPinKey ) |
10位字符定长加密函数
| sSou | 长度不能超过10个字符 |
| iPinKey | 加密Key |
| std::vector< mdwc::Logon_UserInfo > mdwc::MidLinkBase::GetClientLoginInfo | ( | ) |
取得注册的用户信息, 最大500个用户信息
| bool mdwc::MidLinkBase::GetConnectServerInfo | ( | MIDServerInfo & | sInfo | ) |
取得当前连接的中间件配置信息.
| sInfo | 接收中间件配置信息的结构 |
| int mdwc::MidLinkBase::GetConnectStatus | ( | std::string & | sConnectStatus | ) |
取得当前通信连接的状态
| sConnectStatus | 接收当前连接状态的字符变量 |
|
inlinestatic |
取得错误信息.
| std::string mdwc::MidLinkBase::GetLocalMACAddres | ( | ) |
取得网卡地址
|
inline |
取得本机唯一ID
| mdwc::CMidLinkComm * mdwc::MidLinkBase::GetMidLinkComm | ( | const std::string & | sOperate | ) |
从连接池取得连接
| sOperate | 用途描述 |


| mdwc::CMidLinkComm * mdwc::MidLinkBase::GetMidLinkComm | ( | const std::string & | sOperate, |
| const std::string & | sIPAdress, | ||
| short | iCommPort, | ||
| int | iTimeOut = 30, | ||
| const std::string & | sTokenID = "" ) |
从连接池取得通信连接
| sOperate | 用途描述 |
| sIPAdress | 中间件服务器IP地址 |
| iCommPort | 中间件服务器通信端口 |
| iTimeOut | 通信超时值,单位:秒 |
| sTokenID | 连接令牌,用于连接中间件服务器,默认为空值 |

| std::vector< std::string > mdwc::MidLinkBase::GetMidLinkCommPoolStatus | ( | ) |
获取连接池状态信息

| int mdwc::MidLinkBase::GetShowedMessage | ( | mdwc::NET_MESSAGE & | retmsg | ) |
取得短消息
| retmsg | 短信消息结构 |
|
inline |
取得通信加密Key值
|
inline |
是否初始化成功.
|
static |
Mid_Link通信接口基类初始化.
| sProductName | RDMS注册的产品名称 |
| sVersion | RDMS注册的产品版本 |
| sWorkDirectory | 工作目录,为空则取当前目录 |
| eDefaultChatSet | 设置数据传输使用的字符集,默认使用当前连接的中间件字符集,减少数据转换带来的开销 |
| iAutoRecycleCommObjectWaitTimes | 自动回收空闲通信连接的时间,单位秒,为<60不回收 |

| bool mdwc::MidLinkBase::OpenMidLinkComm | ( | const std::string & | sConfigFile = "", |
| bool | bConnectedServer = true ) |
初始化通信接口库.
| sConfigFile | 配置文件名称 |
| bConnectedServer | 是否创建与服务器的连接 |

| bool mdwc::MidLinkBase::OpenMidLinkComm | ( | const std::string & | sIPAdress, |
| int | iCommPort, | ||
| int | iTimeOut, | ||
| const std::string & | sTokenID = "" ) |
使用指定的服务器IP地址和端口初始化通信接口库.
| sIPAdress | 中间件服务器IP地址 |
| iCommPort | 中间件服务器通信端口 |
| iTimeOut | 通信超时值,单位:秒 |
| sTokenID | 连接令牌,用于连接中间件服务器,默认为空值 |


| bool mdwc::MidLinkBase::ReceiveMulticastFile | ( | bool | bEnabled, |
| const std::string & | sFileType = "*" ) |
启用接收多点传送文件的功能
| bEnabled | true启动,false停止 |
| sFileType | 要接收的文件类型标识,自定义 |
| void mdwc::MidLinkBase::RecycleMidLinkComm | ( | int | iFreeTime | ) |
回收长时间占用的空闲连接池资源
| iFreeTime | 空闲时间:秒 |

| int mdwc::MidLinkBase::RegisterRDMS | ( | int | iConnectNo, |
| std::string | sClientID, | ||
| unsigned short | wPort, | ||
| bool | bLogOut, | ||
| bool | bPMPMode ) |
在中间件服务器注册客户端机参数
| iConnectNo | 通信连接号, 如果为零所有的中间件节点都注册 |
| sClientID | 客户端标识客户端标识 |
| wPort | 本地服务端口 |
| bLogOut | 注销 |
| bPMPMode | 反向代理模式 |
| int mdwc::MidLinkBase::RegisterUser | ( | std::string | UserCode, |
| std::string | UserName ) |
在网络上注册当前登录的用户信息,主要用于在各用户之间发送短消息
| UserCode | 登录到系统的用户代码 |
| UserName | 登录到系统的用户名称 |
| void mdwc::MidLinkBase::ReleaseMidLinkComm | ( | mdwc::CMidLinkComm * | comm, |
| bool | bRemove = false ) |
将连接返回给连接池
| comm | 通信连接实例 |
| bRemove | true从连接池中移除,关闭通信连接,并释放连接对象,false不关闭通信连接 |


| bool mdwc::MidLinkBase::SendNetMessage | ( | mdwc::MSG_TYPE | eMsgType, |
| std::string | sMsgContext ) |
组播发送业务消息,需要业务系统解析消息内容
| eMsgType | 消息类型 |
| sMsgContext | 消息内容 |
| int mdwc::MidLinkBase::SendTextMessage | ( | std::string | sReceives, |
| std::string | sMsgContext, | ||
| std::string | sSended ) |
组播文字通信发送消息
| sReceives | 消息接收者,ALL表示广播发送 |
| sMsgContext | 消息内容 |
| sSended | 发送者 |
| bool mdwc::MidLinkBase::SetCommCharSet | ( | MidCharSet | eCharSetID | ) |
设置客户端应用程序字符集.
| eCharSetID | 默认0–GBK(936) 1–GB18030(54936) 2–UTF-8(65001) /returns成功、失败 |
|
static |
反向初始化,关闭所有通信连接,并释放资源
| int mdwc::MidLinkBase::UnRegisterUser | ( | ) |
取消用户注册
| std::unique_ptr<CMDWLogger> mdwc::MidLinkBase::MDWLogger |
MDWClient内部日志处理
| std::unique_ptr<CMidLinkDLL> mdwc::MidLinkBase::MidLinkDLL |
Mid_Link动态链接库引用
| std::unique_ptr<CMidLinkMessage> mdwc::MidLinkBase::MidLinkMessage |
本地通信服务端基类
| std::unique_ptr<CMidLinkServer> mdwc::MidLinkBase::MidLinkServer |
通信库消息处理线程
| std::unique_ptr<CRDMSLogHelper> mdwc::MidLinkBase::RDMSLogHelper |
上传到RDMS信息管理类