Skip to content

Une application de chat utilisant l'invocation de méthode à distance Java (RMI)

Notifications You must be signed in to change notification settings

ElazzouziHassan/RMI-Final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

Simple Chat Application with Java RMI

Table of Contents

Introduction

Welcome to our Simple Chat Application developed using Java RMI. This project demonstrates a basic real-time chat system where users can interact through a centralized server. The application leverages Java RMI for efficient client-server communication, offering both public and private messaging functionalities.

Class Diagram

Features

  • Real-time Messaging: Chat with other users in real time.
  • Public and Private Messages: Send messages to all users or privately to a specific user.
  • User Nicknames: Choose a nickname upon connection.
  • Simple User Interface: Easy-to-use interface for quick interaction.
  • Join/Leave Chat: Connect or disconnect from the chat server at any time.

Architecture

The application follows a client-server architecture using Java RMI. Here's a brief overview:

  • ChatServer: Manages messaging logic and client connections.
  • ChatClient: Connects to the server and allows user interaction via a graphical interface.
  • ChatUI: Provides the graphical user interface for users.
  • ConnectedClient: Manages connected clients and facilitates private messaging.

UML Diagram

Class Diagram

RMI Architecture

RMI Architecture

Installation

Prerequisites

  • Java Development Kit (JDK) 8 or higher
  • Apache Ant (optional, for building the project)

Steps

  1. Clone the repository
  git clone git@github.com:ElazzouziHassan/RMI-Final.git
  cd RMI-Final
  1. Compile the project
javac -d bin src/**/*.java
  1. Start the RMI registry
rmiregistry
  1. Run the server
java -cp bin server.ChatServer
  1. Run the client
java -cp bin client.ChatClient

Note!: After clonig the project, then from you IDE do the following this steps:

  1. Run ChatServer.java
  2. Run ChatUI.java

Usage

  1. Start the server: Ensure the server is running and RMI registry is active.
  2. Launch the client: Open multiple clients to simulate multiple users.
  3. Enter Nickname: Enter a unique nickname for each client.
  4. Send Messages: Use the input field to send public or private messages.
  5. Private Messaging: select a specific user from the list , write your message and click the button "PRV MSG"

Echnical Challenges

Communication Issues

  • Challenge: Ensuring reliable communication between clients and the server.
  • Solution: Implementing Java RMI for direct and real-time communication.

Contributing

We welcome contributions to enhance this project! Please follow these steps:

  1. Fork the repository
  2. Create a new branch
git checkout -b feature/your-feature-name
  1. Make your changes
  2. Commit your changes
  git commit -m "Add your feature"
  1. Push to your branch
 git push origin feature/your-feature-name
  1. Create a Pull Request

License

This project has been developed for educational purposes and it is open source so anyone is free to use as he wish.

Contact

For any questions or feedback, please reach out to us at:

About

Une application de chat utilisant l'invocation de méthode à distance Java (RMI)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages