Multi Thread Receiver In Single Socket
With TCP, I'm designing some programs like next.
clients' recv in many threads are waiting for one server's send message. However, there is a condition. recv is waiting for a specific send message.
thread 1: recv (key = 4) thread 2: recv (key = 6) thread 3: recv (key = 9)
send(value = A) for key 4 - send(value = B) for key 9 - send(value = C) for key 6
then, thread 1 should get value A, thread 3 should get value B, thread 2 should get value C
how can recv function distinguish server send messages? Is there any good idea or solution? Thanks.
recv doesn't support content-filtered data receiving.
You should distinguish those kind of messages on your own.
- → OctoberCMS Backend Loging Hash Error
- → "failed to open stream" error when executing "migrate:make"
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → Create plugin that makes objects from model in back-end
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → How to install console for plugin development in October CMS
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → October CMS - Conditionally Load a Different Page