Game protocol simulation test tools (TcpEngine) Introduction to use

Features

  Were developed some Web developers need to take the binary stream protocol scenarios, such as network game development, in the development stage, front and rear negotiated agreement after. In the development of writing code, sometimes you need to send a complete agreement to end up triggering your own code or perform single stepping through unit testing, but also developing end now, can not be made complete agreement over. In this case, we can use TcpEngine tool simulates send a complete end to our agreement, triggering our code logic.

  TcpEngine is by xml configuration, the Simulator binary stream protocol, a protocol definition, such as the following four parts

 

1.  1 to 4, a total of four bytes is an integer, the length of the message body stored.

2.   5-6 were short integer is two bytes, stored command ID .

3.   7-8 were short integer is two bytes, a fixed value store 123 .

4. Finally, the message body, the length specified by the first four bytes.

  Then TcpEngine object xml configuration as shown below.

<! - with <data> Process Variables body receiving protocol configuration example, sorting position represents the position in the protocol ->

<Data ID = ", msg_len," value = "{int: NET}"> </ Data> <-. 1. 4 ~! common four-byte integer, data received from the network -> 

<Data value = "{Short: NET}"> </ Data> <-. 5 ~. 6! common short integer two bytes, data received from the network ->       

<Data value = "{Short: local: const} 123"> </ Data> <-! ~. 7. 8 were two-byte short integer, fill local fixed value 123-->

  <Data value = "{String: NET: Calc, msg_len, $}"> </ Data> <-! followed by the message body received from the network, received by the length of the variable id = msg_len variable designating ->

  The main function of this tool

1.  By xml configuration binary protocol.

2.  Support analog front end and a rear end (the rear end of the simulation, only the front end of a connection)

3.  Support byte (one byte); Short (two bytes short integer); int (four-byte integer); Long (eight bytes long integer); a float (four byte floating type); Double (eight byte float); JSON string.

4.  Support Tcp and WebSocket two types of network protocols.

5.  save critical data, a protocol following continued use.

6. The  log shows data changes in the testing process, the log can be saved to a file, next time you open the log file to restore the test site.

7.  supports common operator.

8. Support delay or suspend the testing process.

Tools main interface

 

 

 

Running interface

 

Tools Address:  https://pan.baidu.com/s/1P0yPWWiEj8lUvN-a7GwIWw

 

Guess you like

Origin www.cnblogs.com/tcp-engine/p/11540475.html