|
4 | 4 |
|
5 | 5 | - 原因:`LString`的`length()`接口返回中文多字节字符的长度是时候出现了问题(不是网络模块的问题) |
6 | 6 |
|
7 | | - <img src="https://img-blog.csdnimg.cn/4c8b3c9766fb447abb7c54c2d3f6273a.png" alt="image-20231028095754992" style="zoom:80%;" /> |
| 7 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028095754992.png" alt="image-20231028095754992" style="zoom:80%;" /> |
8 | 8 |
|
9 | 9 | - 解决:在`LTcpSocket`类中修改`sends()`函数的代码,改用`std::string().size()`,`Udp`部分也同步修改 |
10 | 10 |
|
11 | | - <img src="https://img-blog.csdnimg.cn/07ca008b68064946b92ff8cdd1428119.png" alt="image-20231028095937250" style="zoom:67%;" /> |
| 11 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028095937250.png" alt="image-20231028095937250" style="zoom:67%;" /> |
12 | 12 |
|
13 | | - <img src="https://img-blog.csdnimg.cn/3b67d47886254ca29efb672da40d1bfc.png" alt="image-20231028100135626" style="zoom:67%;" /> |
| 13 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028100135626.png" alt="image-20231028100135626" style="zoom:67%;" /> |
14 | 14 |
|
15 | 15 | - 测试:在`LTcpDemo`的`test2()`函数中 |
16 | 16 |
|
17 | | -  |
| 17 | +  |
18 | 18 |
|
19 | | -  |
| 19 | +  |
20 | 20 |
|
21 | 21 | ## 2.18836:LAbstractSocket的setbufferSize和bufferSize的注释 与实际功能不太相符 |
22 | 22 |
|
23 | 23 | - 原因:"接收"敲错了 |
24 | 24 |
|
25 | 25 | - 解决:头文件和源文件的对应部分已修改 |
26 | 26 |
|
27 | | - <img src="https://img-blog.csdnimg.cn/2424668159e34729bc6c2ea5bd20f710.png" alt="image-20231028100610343" style="zoom:67%;" /> |
| 27 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028100610343.png" alt="image-20231028100610343" style="zoom:67%;" /> |
28 | 28 |
|
29 | | -<img src="https://img-blog.csdnimg.cn/08b74e1c9cd04a159f5d7e90719ad24a.png" alt="image-20231028100621069" style="zoom:67%;" /> |
| 29 | +<img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028100621069.png" alt="image-20231028100621069" style="zoom:67%;" /> |
30 | 30 |
|
31 | 31 | ## 3.18947:LTcpSocket的客户端buffer=0 调用receives接收服务端的消息后 程序抛出异常并崩溃 |
32 | 32 |
|
33 | 33 | - 疑问:程序走到这个地方,我提前做了判断并且抛出异常的操作,如果符合我的判断,程序理应抛出异常并且结束啊,个人认为这一条`bug`不是很合理,当然我自己做了捕获异常的话那当然是没问题的 |
34 | 34 |
|
35 | 35 | - 测试:在`LTcpDemo`的`test2()`中我设置了设置缓冲区大小为0,做了异常处理,异常被正常捕获,程序后续也正常进行 |
36 | 36 |
|
37 | | - |
| 37 | + |
38 | 38 |
|
39 | | - |
| 39 | + |
40 | 40 |
|
41 | 41 | ## 4.18948:建议给LAbstractSocket的buffer初始化一个合适的大小 |
42 | 42 |
|
43 | 43 | - 解决:设置为`C`标准`IO`库给出的缓冲区大小`BUFSIZ`(`8192`) |
44 | 44 |
|
45 | | - <img src="https://img-blog.csdnimg.cn/ef9e670db0354449aab6c6ee89730cd2.png" alt="image-20231028104804232" style="zoom:67%;" /> |
| 45 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028104804232.png" alt="image-20231028104804232" style="zoom:67%;" /> |
46 | 46 |
|
47 | 47 | - 测试:在`LTcpDemo`的`test2()`中我不给`buffersize`设置任何值(假设我是用户,我忘了),看程序是否正常运行 |
48 | 48 |
|
49 | | -  |
| 49 | +  |
50 | 50 |
|
51 | | -  |
| 51 | +  |
52 | 52 |
|
53 | 53 | ## 5.18832:LAbstractSocket的peerAddress在整个通信过程中获取对方地址时 返回错误 |
54 | 54 |
|
|
58 | 58 |
|
59 | 59 | - 测试:`LTcpDemo`的`test3()`中我分别在相对`sends()`和`receives()`的各个位置都获取了`peerAddress()`的信息 |
60 | 60 |
|
61 | | -  |
| 61 | +  |
62 | 62 |
|
63 | | -  |
| 63 | +  |
64 | 64 |
|
65 | 65 | ## 6.18923:LHostAddress的getAddress 建议调整其内部处理 |
66 | 66 |
|
67 | 67 | - 解决:已做内部处理,地址类型为`Unknown`的时候返回了空指针 |
68 | 68 |
|
69 | | - <img src="https://img-blog.csdnimg.cn/a04fd4a079494c4f8e01ac56dcf3fcf2.png" alt="image-20231028132306772" style="zoom:67%;" /> |
| 69 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028132306772.png" alt="image-20231028132306772" style="zoom:67%;" /> |
70 | 70 |
|
71 | 71 | ## 7.18862:LHttpReply和LHttpRequest的url()返回的数据不完整 |
72 | 72 |
|
73 | 73 | - 原因:在返回url的时候未考虑协议和端口号的显示 |
74 | 74 |
|
75 | 75 | - 解决:在`LHttpRequest`和`LHttpReply`类的`url()`接口中需要补充对协议和端口 |
76 | 76 |
|
77 | | - <img src="https://img-blog.csdnimg.cn/568e97fd83e342b3b5c533228eb95338.png" alt="image-20231028172035316" style="zoom:67%;" /> |
| 77 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028172035316.png" alt="image-20231028172035316" style="zoom:67%;" /> |
78 | 78 |
|
79 | | - <img src="https://img-blog.csdnimg.cn/d10dc942c6274d82bacfead8ed350ea5.png" alt="image-20231028172048947" style="zoom:67%;" /> |
| 79 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028172048947.png" alt="image-20231028172048947" style="zoom:67%;" /> |
80 | 80 |
|
81 | 81 | 当然`LHttpReply`当中虽然有`m_pData`,但是完全没有管端口,我增添了了一个接口`setPort()`,和`setUrl()`对应 |
82 | 82 |
|
83 | | - <img src="https://img-blog.csdnimg.cn/1e863ef61b9f4fa087912fb3424b4ef7.png" alt="image-20231028172254826" style="zoom:67%;" /> |
| 83 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028172254826.png" alt="image-20231028172254826" style="zoom:67%;" /> |
84 | 84 |
|
85 | 85 | 在`LHttpControl`的各种类型的请求收到回复的时候都调用了`setPort()`这个方法,下面是`get`的例子 |
86 | 86 |
|
87 | | - <img src="https://img-blog.csdnimg.cn/5d7337cad3944dd791fa3ab1bb77895f.png" alt="image-20231028172419350" style="zoom:67%;" /> |
| 87 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028172419350.png" alt="image-20231028172419350" style="zoom:67%;" /> |
88 | 88 |
|
89 | 89 | - 测试:在`HttpRequestDemo`的`test2()`中,先用公司的,他的那个测试代码是80端口,但是他的数据有丢失,这个`bug`我还没修 |
90 | 90 |
|
91 | | - <img src="https://img-blog.csdnimg.cn/1a0e9de366a8451eb25c4c9b22d692a5.png" alt="image-20231028172530119" style="zoom: 67%;" /> |
| 91 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028172530119.png" alt="image-20231028172530119" style="zoom: 67%;" /> |
92 | 92 |
|
93 | 93 | 为了测试端口不为80,我下面用了我自己的云服务器测试 |
94 | 94 |
|
95 | 95 | `url`为:http://139.155.152.242:8080/test |
96 | 96 |
|
97 | | - <img src="https://img-blog.csdnimg.cn/72b0f8cb066f4278b337e2ef2e4c476e.png" alt="image-20231028172757806" style="zoom:67%;" /> |
| 97 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028172757806.png" alt="image-20231028172757806" style="zoom:67%;" /> |
98 | 98 |
|
99 | 99 | 请求结果如下: |
100 | 100 |
|
101 | 101 | 协议和端口都显示出来了,这个的数据又全部请求到了,有点奇怪... |
102 | 102 |
|
103 | | - <img src="https://img-blog.csdnimg.cn/6abbaae33b6a4d679b7ade5d0307ff62.png" alt="image-20231028172859801" style="zoom:67%;" /> |
| 103 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028172859801.png" alt="image-20231028172859801" style="zoom:67%;" /> |
104 | 104 |
|
105 | 105 | ## 8.18738:LAbstractSocket的Lsocket函数名有误 |
106 | 106 |
|
107 | 107 | - 解决:将函数名更改为`createSocket()` |
108 | 108 |
|
109 | | - <img src="https://img-blog.csdnimg.cn/11f7a40ab3284b9980b893b40a1bdaa0.png" alt="image-20231028173756696" style="zoom:67%;" /> |
| 109 | + <img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028173756696.png" alt="image-20231028173756696" style="zoom:67%;" /> |
110 | 110 |
|
111 | 111 | ## 9.18811:LUdpSocket的sends(unsigned char\* data,int length) 数据长度设置为0 在接收时程序崩溃 |
112 | 112 |
|
113 | 113 | - 疑惑:在我这边的测试程序中跑出来正常,这条`bug`可能有问题 |
114 | 114 |
|
115 | 115 | - 测试:在`LUdpDemo`的`test2()`中,按照`bug`的指示进行了重现 |
116 | 116 |
|
117 | | -  |
| 117 | +  |
118 | 118 |
|
119 | | -  |
| 119 | +  |
120 | 120 |
|
121 | 121 | ## 10.18808:LUdpSocket的sends(unsigned char\* data,int length) 发送前未设置对方的地址 程序崩溃 |
122 | 122 |
|
123 | 123 | - 疑惑:和第3条一样,我认为抛出异常程序就应该结束,我们自身作捕获异常的操作就可以了 |
124 | 124 | - 测试:在`LUdpDemo`的`test1()`中,设置对方的IP和端口的代码就在下面 |
125 | 125 |
|
126 | | -<img src="https://img-blog.csdnimg.cn/ce90495f0f6949709a35baa65d849405.png" alt="image-20231028175508217" style="zoom:67%;" /> |
| 126 | +<img src="https://image.davidingplus.cn/images/2025/02/01/image-20231028175508217.png" alt="image-20231028175508217" style="zoom:67%;" /> |
127 | 127 |
|
0 commit comments