/
BaseF.tars
70 lines (61 loc) · 3.42 KB
/
BaseF.tars
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Tencent is pleased to support the open source community by making Tars available.
*
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
module basef
{
////////////////////////////////////////////////////////////////
// 定义协议的版本号
const short TARSVERSION = 0x01;
const short TUPVERSION = 0x03;
const short XMLVERSION = 0x04;
const short JSONVERSION = 0x05;
////////////////////////////////////////////////////////////////
// 定义消息的类型
// 普通调用
const byte TARSNORMAL = 0x00;
// 单向调用
const byte TARSONEWAY = 0x01;
////////////////////////////////////////////////////////////////
// TARS定义的返回码
const int TARSSERVERSUCCESS = 0; //服务器端处理成功
const int TARSSERVERDECODEERR = -1; //服务器端解码异常
const int TARSSERVERENCODEERR = -2; //服务器端编码异常
const int TARSSERVERNOFUNCERR = -3; //服务器端没有该函数
const int TARSSERVERNOSERVANTERR = -4; //服务器端没有该Servant对象
const int TARSSERVERRESETGRID = -5; //服务器端灰度状态不一致
const int TARSSERVERQUEUETIMEOUT = -6; //服务器队列超过限制
const int TARSASYNCCALLTIMEOUT = -7; //异步调用超时
const int TARSINVOKETIMEOUT = -7; //调用超时
const int TARSPROXYCONNECTERR = -8; //proxy链接异常
const int TARSSERVEROVERLOAD = -9; //服务器端超负载,超过队列长度
const int TARSADAPTERNULL = -10; //客户端选路为空,服务不存在或者所有服务down掉了
const int TARSINVOKEBYINVALIDESET = -11; //客户端按set规则调用非法
const int TARSCLIENTDECODEERR = -12; //客户端解码异常
const int TARSSENDREQUESTERR = -13; //发送出错
const int TARSSERVERUNKNOWNERR = -99; //服务器端位置异常
/////////////////////////////////////////////////////////////////
// 定义按位的消息状态类型,可复合
const int TARSMESSAGETYPENULL = 0x00; //无状态
const int TARSMESSAGETYPEHASH = 0x01; //HASH消息
const int TARSMESSAGETYPEGRID = 0x02; //灰度消息
const int TARSMESSAGETYPEDYED = 0x04; //染色消息
const int TARSMESSAGETYPESAMPLE = 0x08; //stat采样消息
const int TARSMESSAGETYPEASYNC = 0x10; //异步调用程序
//const int TARSMESSAGETYPELOADED = 0x20; //按负载值调用程序
//const int TARSMESSAGETYPESETED = 0x40; //按set规则调用类型,此字段后面将不使用
const int TARSMESSAGETYPESETNAME = 0x80; //按setname规则调用类型
const int TARSMESSAGETYPETRACE = 0x100; //track调用链消息
/////////////////////////////////////////////////////////////////
};