首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >指定通信协议

指定通信协议
EN

Stack Overflow用户
提问于 2012-08-31 11:35:48
回答 1查看 117关注 0票数 0

我正在尝试记录两个现有系统之间的通信,而这两个系统现在已经非常糟糕了。我想知道是否有任何标准或最佳做法来记录我可以使用的网络通信协议?有几种特殊类型必须有文档记录和混合位顺序。

通信非常简单,就像这样(伪代码)

系统A->系统B (初始化通信)

代码语言:javascript
复制
  short type;                   //Little endian

系统B->系统A

代码语言:javascript
复制
  short type;                   //Little endian
  short count;                  //Little endian
  //Start time
  short NoOfDaysSince1970;      //Big endian
  int   noOfMillisecoundsToday; //Big ending
  if(type==1)
    for(int i=0;i<count;i++)
      char[20] name;
  else
    for(int i=0;i<count;i++)
      float value;    //platform specific float, Little ending
    for(int i=0;i<count;i++)
      short flag;                //Big ending
  //Stop time
  short noOfDaysSince1970;       //Big ending
  int   noOfMillisecoundsToday;  //Big ending
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-08-31 12:09:56

你可以看看抽象语法表示法

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12214538

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档