The problem remains: if you have two clients that each send a command to the uC in quick succession, how do you know which client to send what output to?
If you can answer that question, then what you are trying to do may be possible.
If not, the best you could do is serialise the communications. Ie. a) Accept one client connection; b) read its command; c) send it to the uC; d) retrieve the results; e) send them back to the client; f) disconnect that client; loop back to a.
More fundamentally, will the uC even look for a second command before it has returned all the output from the first command? If not, there is no point trying and no point in using threads.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
|