我编写了一个基于SocketAsyncEventArgs(C#)而不是商业软件的自定义HTTP服务器。当服务器正在侦听端口8080/12345时......没关系。但是只有在端口80上,当浏览器启动与HTTP请求的连接时,它才会显示如下:
- 2785:[SYN] Seq = 0 Win = 8192 Len = 0 MSS = 1460 WS = 4 SACK_PERM = 1
- 2786:[SYN,ACK] Seq = 0 Ack = 1 Win = 8192 Len = 0 MSS = 1460 WS = 256 SACK_PERM = 1
- 2787:[ACK] Seq = 1 Ack = 1 Win = 65700 Len = 0
- 2788:[RST] Seq = 1 Win = 65536 Len = 0
- 3538:HTTP 767 GET /push_push.do?imei=356708041124742&simno=4600230 ... blah blah
请注意,当客户端发送类似“socket.Send(http_bytes);”的HTTP请求时,将连续发送TCP消息号2788 [RST]和号码3538 [正常HTTP请求]。
========================
请给我一个建议:
- [RST]如何来自以及如何避免它?
- 为什么监听端口会影响?