The mission: Implement a program that will listen to multiple client requests asynchronously (on TCP) and transfer them to a server (also on TCP) to which only one connection is allowed. The program will also receive answers from the server and transfer each answer to the relevant client.
The question: What is the best way to implement this using c#?
From reading on the Internet I understood that I can use an asynchronous socket, and handle everything based on events. No need to use a thread pool. Am I correct?
This is the best example I found: https://gist.github.com/leandrosilva/656054
But from it I only figured out how to receive client requests and deliver them to the server. I still don't understand how to receive an answer from the server and deliver it to a relevant client using events of asynchronous socket?
Will appreciate your insights and help.
PS: I'm on a closed network, and have no VS on the internet computer, that is why I can't paste my code here. But currently my code looks a lot like in the example above (https://gist.github.com/leandrosilva/656054)