Coder Social home page Coder Social logo

kochlisgit / java-multithreading-server-chat Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 9.18 MB

This is a simple Team Chat written in Java.

HTML 0.78% Java 99.22%
java multi-threading multi-threaded-server server-queues message-queues client server-client javafx gui communication

java-multithreading-server-chat's Introduction

FastChat

This is a simple Team Chat written in Java for a school project. Multiple Clients can connect with a server and send messages. The Server receives the messages and send them back to all connected clients.

Overview

Fast Chat is a multi-threaded Server-Client implementation, where multiple clients can connect to a server and communicate all together.

alt text

alt text

Server

In order for this App to work, there must be a server running in the background, so that clients can connect to. The server uses the Machine's Local IP Address and Port: 4, so clients must know this IP Address in order to connect.

The server is Mutli-Threaded A thread listens to connections and a ClientHandler handles the connections. The way it Works is simple. The server starts a Listener thread that waits clients to connect. Every time a client connects then the server passes the client's socket to ClientHandler. ClientHandler controls the ServerReceiver and the ServerSender. ServerReceiver listens to messages coming from clients and puts them in a queue. ServerSender takes messages from the queue and sends them to every connected client.

Clients

Clients can connect to server via the Application's GUI. Clients can send message and receive the Name of the client who send the message, the message and the time the message was sent. Clients can connect and disconnect as long as the server is running.

Features

  1. A Very simple and easy to use Graphical User Interface (GUI)
  2. A Multi-threaded server that automatically configures the server's settings.
  3. All clients are connected.
  4. The chat can be exported as PDF! The file is created in the user's **Download"" folder as chat.pdf

How to Run

This app was written with jdk-11.0.2. Also it uses javafx-sdk-11.0.2. Additionally, it uses Apache PDFBox library to convert text to PDF. This library is uploaded in the project's folder.

-- Steps

  1. Download jdk-11.0.2 Download here

  2. Download javafx-sdk-11.0.2 Download here

  3. Import the app to Eclipse or Intellij.

  4. Go to Project Structure and add jdk-11.0.2 and javafx-sdk-11.0.2. This link can help you setup javafx-sdk Documentation

  5. Add Apache PDFBox library to the project.

  6. Compile and Run Server.java javac servers/Server.java

java servers/Server

  1. Run FastChatMain.java as a client from any machine.

Important: You will need to know the host's IP (The IP of the machine that runs the server) in order to get this to work.

java-multithreading-server-chat's People

Contributors

kochlisgit avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.