Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
suppose there are many clients whose are sending message to any other client via server and here socket programming and thread are used. how does server distinguish particular destination client and forward it the message. Need suggestion. Thanks.
Posted
Comments
Sergey Alexandrovich Kryukov 2-Apr-14 12:30pm    
This is way too vague. The answer is: read literature on systems, networking, threading, tiers, architecture and a lot more. Do you want some of us to write a book on all those topics specially for you? Is would hardly be realistic. If you are a beginner, you have establish some well-defined and pretty moderate goal for you and try to design and create such system. Then your question, much more bounded in scope, could really help.
—SA

1 solution

As a simple approach, your clients could send messages containing either the actual data (the payload) and additional information, useful to deliver correctly the message itself (see, for instance the "payload" Wikipedia page[^]). Based on such additional information the server could dispatch the messages to the destination clients.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900