跳转至

SubmitUserSystemInfo

上报用户终端信息,用于中继服务器操作员登录模式,操作员认证登录后,可以多次调用该接口上报不同客户信息。

1.函数原型

virtual int SubmitUserSystemInfo(CThostFtdcUserSystemInfoField *pUserSystemInfo) = 0;

2.参数

pUserSystemInfo:用户系统信息

字段类型字段名称含义
TThostFtdcBrokerIDType BrokerID 经纪公司代码 必填
TThostFtdcUserIDType UserID 用户代码 必填
TThostFtdcClientSystemInfoType ClientSystemInfo 用户端系统内部信息 必填
TThostFtdcIPAddressType ClientPublicIP 终端IP端口 必填
TThostFtdcTimeType ClientLoginTime 登录成功时间 必填
TThostFtdcAppIDType ClientAppID App代码 必填
TThostFtdcSystemInfoLenType ClientSystemInfoLen 用户端系统内部信息长度 必填
TThostFtdcIPPortType ClientIPPort 终端IP端口 必填

UserID:此处应该填终端的投资者账号,即InvestorID,而非操作员账号。

ClientSystemInfoLen:加密后的用户终端系统内部信息的长度

ClientSystemInfo:加密后的用户终端系统内部信息。

ClientPublicIP:用户终端IP,由中继服务器采集和填写

ClientLoginTime:用户登录中继时间,由中继服务器采集和填写

ClientAppid:用户终端的AppID,由中继服务器采集和填写

3.返回

0 正确

-1 字段长度不对

-2 非CTP采集的终端信息

-4 当前用户非一对多操作员

-5 字段中存在非法字符或者长度超限

-6 采集结果字段错误

4.调用示例

//一对多中继终端使用方法

Step 1 中继在启动后,在API连接后发起认证

ReqAuthenticate();

Step 2 认证成功后发起登录

ReqUserLogin();

Step 3 终端登录中继时,中继上报用户终端信息

char pSystemInfo[344];
int len;
CTP_GetSystemInfo(pSystemInfo, len);
CThostFtdcUserSystemInfoField field;
memset(&field, 0, sizeof(field));
strcpy(field.BrokerID, "8888");
strcpy(field.UserID, "880002");
memcpy(field.ClientSystemInfo, pSystemInfo, len);
field.ClientSystemInfoLen = len;
strcpy(field.ClientPublicIP, "255.0.0.255");
field.ClientIPPort = 65533;
strcpy(field.ClientLoginTime, "11:28:28");
strcpy(field.ClientAppID, "API sub");
m_pUserApi->SubmitUserSystemInfo(&field);

5.FAQ