检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:朱彬 Zhu Bin(The Third Research Institute of the Ministry of Public Security,Shanghai 200000,China)
机构地区:[1]公安部第三研究所,上海200000
出 处:《信息与电脑》2020年第13期176-178,共3页Information & Computer
摘 要:本文主要通过一款用C++开发的协议生成工具来说明代码生成技术在网络通信中的应用。该工具通过读取固定格式的模板文件生成可以用C++编译器编译的源文件和头文件,这些源文件和头文件通过编译后,可以进行序列化和反序列化。然而,把程序中的数据结构按照自定义协议进行传输,就需要序列化,反之,把网络传输过来的数据用于程序中的数据结构就需要反序列化。本文提及的工具正是从实际应用角度出发,通过工具生成代码,然后将代码编译应用到网络通信自定义协议的序列化和反序列化,最终实现网络通信。这样一套流程充分证明了代码生成技术是可以应用在网络通信中,具有重要的现实意义。This paper describes the application of code generation technology in network communication through a protocol generation tool developed with C++.The tool can generate source files and header files that can be compiled by C++compiler by reading template files in fixed format.These source files and header files can be serialized and deserialized after being compiled.However,if the data structure in the program is transmitted according to the custom protocol,it needs to be serialized.On the contrary,if the data transferred from the network is used for the data structure in the program,it needs to be deserialized.The tool mentioned in this paper is just from the perspective of practical application.Code is generated by the tool,and then the code compilation is applied to the serialization and deserialization of network communication custom protocol,and finally network communication is realized.Such a set of process fully proves that code generation technology can be applied in network communication and has important practical significance.
关 键 词:代码生成器 网络通信 自定义协议 C++ 序列化
分 类 号:TP311.52[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:3.145.49.32