1 / 9
文档名称:

通信协议定义.doc

格式:doc   页数:9页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

通信协议定义.doc

上传人:012luyin 2014/11/22 文件大小:0 KB

下载得到文件列表

通信协议定义.doc

文档介绍

文档介绍:T-3GABS 项目网络通信协议设计
版本: 日期: 2011/03/07更新作者: 唐亮(达内集团教学研发部)
网络通信协议概述
通信模式
T-3GABS项目的网络通信模式采用无状态的同步通信模式。
无状态:在客户端与服务器的一次完整会话过程中,没有始终建立的一条确定的连接,而是在每次客户端需要请求服务器的服务时临时建立连接,并且服务完成,连接则关闭。
同步通信:客户端和服务器的通信模式严格遵循请求/应答模式,每一次请求对应一次应答。
通信技术实现
在T-3GABS项目中客户端与服务器的通信方式采用Socket通信来完成,在Socket中传递Java对象(使用Java对象序列化机制),具体而言,在Socket中传递的是Request(请求)和Response(应答)对象。而Request和Response对象中封装一个Map来保存需要传递的参数,(可序列化)接口。Request和Response的定义详情如下所示:
Request(请求)类的定义
public class Request implements {
private static final long serialVersionUID=-2017141596837742L;
public static final PARE_PROGRAM_VERSION_REQUEST =0x1; //比较版本请求
public static final int UPDATE_BUSINESS_DATA_REQUEST =0x2; //更新业务数据请求
public static final int LOGIN_REQUEST=0x3; //登录请求
public static final int REGISTE_REQUEST=0x4; //注册用户请求
public static final int SEARCH_FLIGHT_REQUEST=0x5; //查询航班请求
public static final int ORDER_REQUEST=0x6; //订票请求
public static final int PAYMENT_REQUEST=0x7; //支付请求
public static final int FIND_ORDER_REQUEST=0x8; //查询订单请求
public static final int DELETE_ORDER_REQUEST=0x9; //删除订单请求
public static final int ADD_PASSENGER_REQUEST=0xa; //添加乘客请求
public static final int MODIFY_PASSENGER_REQUEST=0xb; //修改乘客请求
public static final int REMOVE_PASSENGER_REQUEST=0xc; //删除乘客请求
public static final int ADD_CONTACT_REQUEST=0xd; //添加联系人请求
public static fin