UDP Chat Room using java
In this project, you are required to design and implement a chat room server and chat room client using UDP socket programming.
Requirements
Behaviors of the ChatRoomServer
ChatRoomServer maintains the chat room. It will always maintain a set/list of active clients in the chat room. It will also manage all related messages (from and to the clients). The ChatRoomServer doesn’t need multiple threads to meet the requirements.
• Whenever a new client joins the chat room: the ChatRoomServer sends a welcome message to the newly joined client. It also notifies all other existing clients in the chat room that a new client just joined. It will add this new client to the active clients set/list.
• Whenever an existing client leaves the chat room: the ChatRoomServer notifies (broadcasts to) all existing clients that a client left the chat room. It removes the leaving client from the active clients set/list. (It also needs to cooperate with the leaving client program, so that the leaving client program can gracefully terminate.)
• Whenever an existing client sends a message to the chat room: the ChatRoomServer sends the message to all other existing clients in the chat room.
• The notifications and messages involved above should bear unique identifier of the client, for example, the IP address and the port number used by the client.
Behaviors of the ChatRoomClient
ChatRoomClient is the client program, allowing users to use the chat room service.
• The client automatically joins the chat room when the client program is run. This can be implemented by sending a special message to the ChatRoomServer, for example, “@_@Join”, “$$$JOIN”, “!Join”, etc.
• The client allows the user to input a special message to leave the chat room, for example, “@_@Quit”, “$$$QUIT”, “!Quit”, etc. When the user issues this message, make sure that the client program terminates gracefully, so as not to cause problems for the server, and not to affect the future rerunning of the client and running of new clients.
• When the user types in some message, the client sends the message to the ChatRoomServer. The message needs to be sent to all other clients (excluding the sending client) in the chat room. This is done by the server program.
• When the local client is running and in the chat room, it should always wait for messages sent from the chat room server. For example, when another client in the chat room sends a message to the chat room, the ChatRoomServer will send the message to this local client, because the server does broadcasting.
• Notice that each client should do two things at the same time: 1. Wait for user’s input & send the message out, and 2. Wait to receive message from the server and print the message on the standard output. Thus, you are required to implement multi-threading on the client to allow it to do these two things simultaneously.
Although the server needs to broadcast messages, do not use broadcast sockets. Just use a normal UDP socket on the server side, when it needs to broadcast to multiple clients, just use the same UDP socket to send to the clients one by one.
Hello
I have excellent programming and development skills. Contact me with all the details and requirements for your project for further discussion. I will provide you dedicated support and follow-up.
Regards
Farah Khan
Hi..I am proficient in core Java OO programming with data structures, algorithms, TCP/UDP socket programming and can help you write the client/server chat room application as per given specs using UDP sockets and simple GUI using Java Swings.
Hello,
I've complete MS Software Engineering. I've 5-Year experience in Java development and algorithm implementation.
My Core Expertise in Java - C++ - C - object-oriented - Data Structure - Swing - OpenGL - JavaFX.
I have got your project requirement enough, Please leave a message on my chat so we can discuss the
project.
Best Regards:
Aqeel Ahmed
Hello
I am Sun Certified Java Programmer. I am highly experienced in Java Technologies, OOP, Data Structures, Database Driven applications, APIs, Files handling and Data Transformation, ETL and various frameworks. I can help implement awesome Java desktop (Console, Swing, JavaFX), Web (JEE, Spring) and Android apps. I assure you an excellent solution of your project within the time frame and exactly according to the requirements.
Thanks
@CodingHelpLine