Delphi - 可以同时使用 Indy TIdTCPClient Send/Receive 大流

Delphi - Can indy TIdTCPClient Send/Receive large streams at the same time

是否可以在同一客户端TIdTCPServer/TIdTCPClient同时Send/Receive大流。

我已经在客户端创建了一个线程来处理传入的请求。

客户端收到请求,但在上一个请求完成(发送或接收)之前不会将其发送回服务器。

Is it possible to Send/Receive large streams at the same time with TIdTCPServer/TIdTCPClient with the same client.

是的,可能。但是 如何 取决于您的协议实现。 TCP 套接字是双向和全双工的。您可以让一个线程发送,而另一个线程正在接收。或者你可以将你的流分解成块,这样一个线程就可以发送一个块,读取一个块,发送一个块,读取一个块,等等。

I have create a thread on the client side to handle the incoming requests.

Client receive the request but it will not send it back to the server until the previous requite finished (sent or received).

这意味着您在单个线程中进行处理,并且以串行方式一次处理一个请求,在上一个响应完成之前,您不会从连接中读取下一个请求先发送。虽然这是 典型 模型,但它可能不是 正确 模型,具体取决于您的特定需求。