Click here to Skip to main content
14,974,312 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i am student of computer science i have developed a client server chat application using c in linux. my client and server both are multi threaded both can send and receive data at same time. now i want that my server should be able to pass data between the clients . when a client is connected to the server the server should send the list of all available clients to it and client should be able to select the client to which it wants to communicate.. please give me step by step description that how should i do it.. shall i create a database for this purpose or it can be done with a file??
Posted

1 solution

A database is a better approach, as it handles searching and deletions more easily than a flat text file: but in reality you don't particularly need either: an in-memory collection of connected clients is probably all you need. Since the socket connections would not be persisted once the application closes, your server will always start with an empty client list - so why would you need to persist the "who-is-connected?" data?
   

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