1

我正在尝试使用简单的 TCP 套接字模拟客户端和服务器之间的 HTTP 通信——它可以工作,但不适用于所有用户。其中一些在发送第二条消息时被丢弃。我确实发送到服务器(消息是 base64 编码的):

POST / HTTP/1.1
Connection: keep-alive
Content-type: text/plain
Content-length: 4

AwEc

并从中做出回应:

HTTP/1.1 200 OK[trailing space here]
Connection: Keep-Alive
Content-Type: text/plain
Content-Length: 4

AwEc

如果我从客户端向服务器发送另一条消息 - 连接会立即断开。我能错过什么?

4

0 回答 0