Reputation: 2330
Is it possible to Send/Receive large streams at the same time with TIdTCPServer/TIdTCPClient with the same client.
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).
Upvotes: 2
Views: 940
Reputation: 598448
Is it possible to Send/Receive large streams at the same time with TIdTCPServer/TIdTCPClient with the same client.
Yes, it is possible. But how you do it depends on your protocol implementation. TCP sockets are bi-directional and full-duplex. You could have one thread sending while another thread is receiving. Or you can break up your streams into blocks so one thread can send a block, read a block, send a block, read a block, etc.
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).
This implies that you are doing your processing in a single thread, and doing the entire processing one request at a time in a serial manner, where you are not reading the next request from the connection until the previous response has been sent first. While this is the typical model, it might not be the right model, depending on your particular needs.
Upvotes: 3