网络通讯调试器(Network communication Debugger)介绍和使用说明

谢谢各位的支持,我一般只有业余时间修改应用,所以我会尽快修改或改进诸位提出的功能要求,iOS8发布在即,我也会尽快修改应用支持新的系统,再次谢谢各位的支持

最近有一些下载了应用的朋友说这个工具要是能在广域网中使用就好了,关于这个问题这里做一个简单的解答:这个工具是可以在广域网中使用的,只要你的路由器上映射一个外网的端口(TCP或者UDP的端口),,这样配合上你的外网IP,你就可以在广域网上收发数据,这是一个网络设置的问题,不需要在应用里面解决,在这里也谢谢各位喜欢这个应用。

应用已上线(app is online):

https://itunes.apple.com/us/app/wang-luo-tong-xun-diao-shi-qi/id682270868?ls=1&mt=8

网络通讯调试器(Network communication Debugger)是一款集UDP、TCP,服务端和客户端为一体的工具类app,适用于各类需要网络通讯调试的攻城狮或技术人员使用,下面主要介绍一个app的主要功能和使用。

Network communication debugger is a set of UDP, TCP, and client service for the integration of tools app, applicable to all types need to debug network communications engineers or technicians, the following describes an app’s main features and use.

所有的页面返回全部采用手势滑动返回,除了“帮助”页面采用返回按钮。

All return all pages using gestures sliding back, in addition to the "Help" page using the Back button

1.通讯类型TCP还是UDP,这应该不是个问题,根据各位的通讯类型需要点击不同的按钮进入下一步进行相关的参数设置

1.Type of communicationTCP or UDP, this should not be a problem, according to the type of communication you need to click the button to enter the next step for different setting of parameters related

2.通讯参数通讯参数中分为两类参数,一类是通讯地址、端口之类的参数,另一类是所需发送、接收的数据类型参数

2.Communication ParametersCommunication parameters in two types parameters, one is mailing address, port parameters,The other is required to send, receive data type parameters

2.1通讯地址参数

做为服务端时,需要设置“本地端口”做为监听端口来接收数据。特别说明一下,做为UDP服务端时,不能先给UDP客户端发送数据,只能在收到UDP客户端数据以后,服务端才能依据客户端的地址,发送数据给客户端。

2.1 Address parameterAs the server, you need to set the "Local Port" as the listening port to receive data.Special instructions as UDP server, you can not give UDP client to send data, only data after receiving UDP client, the server can be based on the client’s address, send data to the client.

2.2数据类型参数

主要分为接收数据和发送数据,其中字符集主要针对中文,采用GBK字符集和UTF-8字符集所发送或者接收的中文是不相同的,采用GBK字符集的单个中文字为2字节,而采用UTF-8字符集的单个中文字为3个字节,如果采用16进制方式收发数据,可以不需要考虑字符集的选择;

16进制数据发送时,需要按照16进制的字符要求组成发送数据,也就是只能发送由"0123456789abcdefABCDEF"这里面的字符组成的数据发送,如果发送的数据为中文、符号、其他国家文字等,都是为无效数据,无法发送,2个16进制字符串为1个字节,比如:E58886->0xE5 0x88 0x86表示3个字节,如果发送字符如:E5888,那么app则认为只发送0xE5和0x88两个字节,最后一个8自动舍弃,也就是发送的16进制字符串长度必须是偶数。

2.2 Data type parameterMainly divided into the receive data and send data, which focused on Chinese character set, using GBK character set and UTF-8 character set of the Chinese sent or received is different, using a single character set GBK Chinese character is 2 bytes, the use of UTF-8 character set for the three single-byte text, if the hexadecimal send and receive data, you can not consider the character set selection;Hexadecimal data transmission, it is necessary in accordance with the requirements of 16 hexadecimal characters composed of transmitting data, which is transmitted only by the "0123456789abcdefABCDEF" This is inside the characters of data sent, if the data sent to Chinese, symbols, text, etc. in other countries , are for the invalid data can not be sent, two hexadecimal string is a byte, for example: E58886-> 0xE5 0x88 0x86 indicates three bytes, if the transmit characters such as: E5888, then the app is considered only send 0xE5 and 0x88 two bytes, the last 8 automatically discarded, which is sent in hexadecimal string length must be even.

3.通讯数据交互

上面的各项参数设置好以后,下面就可以开始进行数据通讯了,日志信息框中会提示相关的接收、发送数据等信息,其中日志格式为:时间 日志类型 内容;日志类型分为4种:L-普通信息日志,R-接收数据日志,S-发送数据日志,E-错误信息日志

3.Communication data interactionAbove parameters is set up after you can begin the following data communication, the log message box will prompt the associated receive and send data and other information, including the log format is: Time-log type-content; log types are divided into four kinds: general information L-log, R-receive data log, S-transmit data log, E-error log

后记:

app中的TCP通讯中暂时没有进行粘包处理,在实际通讯中是需要进行粘包处理的

经验是由痛苦中粹取出来的

网络通讯调试器(Network communication Debugger)介绍和使用说明

相关文章:

你感兴趣的文章:

标签云: