问题描述
我在PC中使用VC ++中的MFC。
在我的TCP / IP套接字通信中,我的客户端套接字丢失了当它遇到一个严重的异常错误并且程序终止时。
接下来,客户端程序重启以使新的套接字连接到同一个服务器,有很多复位控制Wireshark屏幕上的消息和循环。
我无法理解消息的含义,所以让我告诉直接编码方法。
来源目的地港口号信息
----------------------------- -------------------------------------------------- -------------
服务器 - >客户3999-> 3224 [PSH,ACK] Seq = 101743 Ack = 11 Win = 5840 Len = 55
服务器 - >客户3999-> 3224 [PSH,ACK] Seq = 101798 Ack = 11 Win = 5840 Len = 51
客户 - >服务器3224-> 3999 [ACK] Seq = 11 Ack = 101849 Win = 62992 Len = 0
此时PC客户端因异常错误而终止并发送以下重置消息。
客户 - >服务器3224-> 3999 [RST,ACK] Seq = 11 Ack = 101849 Win = 0 Len = 0
接下来,客户端重新启动以创建新套接字(3361并尝试与同一服务器通信。
客户 - >服务器3361-> 3999 [SYN] Seq = 0 Win = 8192 Len = 0 MSS = 1460 WS = 256 SACK_PERM = 1
服务器 - >客户端3999-> 3361 [RST,ACK] Seq = 1 Ack = 1 Win = 0 Len = 0
客户端 - >服务器3361-> 3999 [TCP虚假重传] Seq = 0 Win = 8192 Len = 0 MSS = 1460 WS = 256 SACK_PERM = 1
服务器 - >客户端3999-> 3361 [RST,ACK] Seq = 1 Ack = 1 Win = 0 Len = 0
客户端 - >服务器3361-> 3999 [TCP虚假重传] Seq = 0 Win = 8192 Len = 0 MSS = 1460 SACK_PERM = 1
服务器 - >客户3999-> 3361 [RST,ACK] Seq = 1 Ack = 1 Win = 0 Len = 0
......
请告诉我这个案例的正确代码方法。
谢谢。
我尝试了什么:
超过1周,我浪费了我遇到这个问题的时间。
Hi,
I use MFC in VC++ in PC.
In my TCP/IP socket communication, my client socket is lost when it met a critical abnormal error and program terminated.
Next, the client program restart to make a new socket to connect to the same server, there are many reset control messages and looping in the Wireshark screen.
I cannot understand the meaning of messages, so let me tell the direct coding methods.
Source Destination Port No. Informations
--------------------------------------------------------------------------------------------
Server -> Client 3999-> 3224 [PSH, ACK] Seq=101743 Ack=11 Win=5840 Len=55
Server -> Client 3999-> 3224 [PSH, ACK] Seq=101798 Ack=11 Win=5840 Len=51
Client -> Server 3224-> 3999 [ACK] Seq=11 Ack=101849 Win=62992 Len=0
In this point PC Client terminated with abnormal error and send following reset message.
Client -> Server 3224->3999 [RST,ACK] Seq=11 Ack=101849 Win=0 Len=0
Next, Client restarted to make a new socket(3361) and to try to communicate with the same Server.
Client -> Server 3361->3999 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1
Server -> Client 3999->3361 [RST,ACK] Seq=1 Ack=1 Win=0 Len=0
Client -> Server 3361->3999 [TCP Spurious Retransmission] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1
Server -> Client 3999->3361 [RST,ACK] Seq=1 Ack=1 Win=0 Len=0
Client -> Server 3361->3999 [TCP Spurious Retransmission] Seq=0 Win=8192 Len=0 MSS=1460 SACK_PERM=1
Server -> Client 3999->3361 [RST,ACK] Seq=1 Ack=1 Win=0 Len=0
......
Please let me know the correct code method of this case.
Thank you.
What I have tried:
Over 1 week, I wasted my time of this problem.
推荐答案
这篇关于如果异常终止,如何重新连接最新的套接字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!