Well, that's all in the application logic:
- receive a request
- forward to the server
- wait for the reply
- forward to the client
Considering that you'll have 2 sockets (one from/to the client and one from/to the server) you can couple them. However the coupling will have to be done in the HandleAccept callback.
Every TCP socket will fire a HandleAccept callback (if set) when a new connection is made.
I'd expect that fo every new connection from a client you'll open a new connection to the server - in the HandleAccept is the best option.
Afterwards, you can just check where a request (or reply) comes from just by checking the socket, and forward it to the other one.
Hope it is clear,
T.