Code Monkey home page Code Monkey logo

simple-tcp-chat-room-in-java's Introduction

Simple TCP Chat Room in Java ๐Ÿ’ฌ

This repository contains a straightforward Java-based chat application using the TCP protocol, consisting of a server and a client.

Server ๐Ÿ’ป

The server is responsible for handling incoming client connections and facilitating communication between clients. It allows clients to send messages, change their nicknames, and gracefully quit the chat. The server is a multithreaded application, capable of handling multiple client connections simultaneously.

How to Run the Server โš™๏ธ

Follow these steps to run the server:

  1. Compile the Server.java file.
  2. Run the compiled Server class.

The server will start listening on port 9999 for incoming client connections.

Client ๐Ÿ‘ฅ

The client is a command-line application that connects to the server, enabling users to send and receive messages in a chat room. Clients can also change their nicknames and quit the chat gracefully.

How to Run the Client โš™๏ธ

Follow these steps to run the client:

  1. Compile the Client.java file.
  2. Run the compiled Client class.

The client will connect to the server running on 127.0.0.1 (localhost) on port 9999 by default. You can change the server address in the Client class if needed.

Usage ๐Ÿ’ก

  • When a client connects, they will be prompted to enter a nickname.
  • Clients can send messages to the chat by typing their messages and pressing Enter.
  • To change their nickname, clients can use the "/nick" command followed by the desired nickname (e.g., "/nick NewNickname").
  • To quit the chat, clients can use the "/quit" command.

Features ๐Ÿš€

  • Multithreaded server that can handle multiple client connections simultaneously.
  • Ability for clients to change their nicknames to distinguish themselves in the chat.
  • Graceful handling of client disconnections.

Known Issues โ—

  • Clients may need to press Enter after sending a message to see new messages from other users due to buffering.

Contributing ๐Ÿ› ๏ธ

This is a basic chat application using the TCP architecture and can be further improved and extended. You can contribute to this project by:

  • Enhancing its features.
  • Improving its user interface.
  • Fixing any known issues.

We welcome your contributions to make this chat room more robust and user-friendly. Please check the issues section for any existing tasks or propose your enhancements.

Feel free to fork this repository, make your improvements, and submit a pull request to help us make this project better!

Happy chatting! ๐ŸŽ‰

simple-tcp-chat-room-in-java's People

Contributors

okdotdev avatar

Stargazers

Charitha C S avatar

Watchers

 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.