zachattack05 70 Posting Pro in Training

I am building an async socket server to receive and process incoming commands.

The model I am working on has the sockets receive the data and send it to a "Interpreter" class. I need a way for the interpreter class to know who sent the command to interpret to it, so that once it is finished performing actions on the data it can return the result to the correct socket instance so the data can be returned to the client.

Does that make sense?

I was thinking about using some sort of thread reset event and would just have the interpreter save the result in some dictionary or array of some sort and call a reset event letting the socket unblock and check for the result in that dictionary or array (whatever), read it and send it back.

Any thoughts or ideas?