Files
QTradeProgram/include/Proto/InitConnect.proto
2025-08-15 15:57:31 +08:00

44 lines
2.3 KiB
Protocol Buffer
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto2";
package InitConnect;
option java_package = "com.futu.openapi.pb";
option go_package = "github.com/futuopen/ftapi4go/pb/initconnect";
import "Common.proto";
message C2S
{
required int32 clientVer = 1; //客户端版本号clientVer = "."以前的数 * 100 + "."以后的举例1.1版本的clientVer为1 * 100 + 1 = 1012.21版本为2 * 100 + 21 = 221
required string clientID = 2; //客户端唯一标识,无生具体生成规则,客户端自己保证唯一性即可
optional bool recvNotify = 3; //此连接是否接收市场状态、交易需要重新解锁等等事件通知true代表接收FutuOpenD就会向此连接推送这些通知反之false代表不接收不推送
//如果通信要加密首先得在FutuOpenD和客户端都配置RSA密钥不配置始终不加密
//如果配置了RSA密钥且指定的加密算法不为PacketEncAlgo_None则加密(即便这里不设置配置了RSA密钥也会采用默认加密方式)默认采用FTAES_ECB算法
optional int32 packetEncAlgo = 4; //指定包加密算法参见Common.PacketEncAlgo的枚举定义
optional int32 pushProtoFmt = 5; //指定这条连接上的推送协议格式若不指定则使用push_proto_type配置项
optional string programmingLanguage = 6; //接口编程语言,用于统计语言偏好
}
message S2C
{
required int32 serverVer = 1; //FutuOpenD的版本号
required uint64 loginUserID = 2; //FutuOpenD登陆的牛牛用户ID
required uint64 connID = 3; //此连接的连接ID连接的唯一标识
required string connAESKey = 4; //此连接后续AES加密通信的Key固定为16字节长字符串
required int32 keepAliveInterval = 5; //心跳保活间隔
optional string aesCBCiv = 6; //AES加密通信CBC加密模式的iv固定为16字节长字符串
optional int32 userAttribution = 7; //用户类型牛牛用户或MooMoo用户
}
message Request
{
required C2S c2s = 1;
}
message Response
{
required int32 retType = 1 [default = -400]; //返回结果参见Common.RetType的枚举定义
optional string retMsg = 2; //返回结果描述
optional int32 errCode = 3; //错误码客户端一般通过retType和retMsg来判断结果和详情errCode只做日志记录仅在个别协议失败时对账用
optional S2C s2c = 4;
}