Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Multi - threaded and Multi - user Chat Application with using C language. In this project, you are expected to develop a messaging server and
Multithreaded and Multiuser Chat Application with using C language.
In this project, you are expected to develop a messaging server and client using socket programming. In this system, there will be multiple clients and a single server. Clients will communicate with the server using the LIST, LOGIN, LOGOUT, MSG INFO, and REGISTER commands.
Requirements
The messaging server and client you develop must support at least the following commands:
LIST
o Used to list the users on the server and their onlineoffline status.
o Usage: LIST mask
o mask indicates the listing mask created with or
LOGIN
o Allows a user to log into the system.
o Usage: LOGIN mood
username: The user's name.
password: The user's password.
mood optional: The user's current mood.
LOGOUT
o Allows the active user to log out of the system.
o Updates the user's status on the server and terminates the thread associated with this user.
MSG
o Sends a message to a specific user or all online users.
o Usage: MSG
username: The name of the user to whom the message will be sent. If is used, the message is sent to all online users.
message: The text of the message to be sent.
INFO
o Shows the first name, last name, and mood of the specified user.
o Usage: INFO
username: The name of the user whose information is requested.
REGISTER
o Allows a new user to register in the system.
o Usage: REGISTER
username: The name of the new user.
firstname: The first name of the new user.
lastname: The last name of the new user.
password: The password of the new user.
Persistence
The messaging server and client application to be developed should be designed to work continuously and be reusable. Users should be able to continue messaging and communicating as long as the system is not shut down.
Client Application
The client application will show from whom the message was received when a message is received.
Commands can be taken one by one or in bulk; you are free in this regard.
Multithreading
A separate thread will be created for each user who logs into the system, and the application will work in a multithreaded manner.
Storing User Information
User information will be stored in a text file. This file will contain usernames, first names, last names, passwords, and mood information.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started