Coder Social home page Coder Social logo

enyason / chat-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abhi195/chat-server

0.0 2.0 0.0 7 KB

A multithreaded client/server Chat application based on the console which uses Java Socket programming and multi-threading.

Java 100.00%

chat-server's Introduction


About:


It is a multithreaded client/server ChatServer based on console which uses Java Socket programming. A server listens for connection requests from clients across the network or even from the same machine. Clients know how to connect to the server via an IP address and port number. After connecting to the server, the client gets to choose his/her username on the chat room. The client sends a message, the message is sent to the server using ObjectOutputStream in java. After receiving the message from the client, the server broadcasts the message if it is not a private message. And if it is a private message which is detect using โ€˜@โ€™ followed by a valid username, then send the message only to that user. Java object serialization to transfer the messages.


Instructions:


Client

To start the Client in console mode use one of the following command

  1. java Client
  2. java Client username
  3. java Client username portNumber
  4. java Client username portNumber serverAddress

at the console prompt If the portNumber is not specified 1500 is used If the serverAddress is not specified "localHost" is used If the username is not specified "Anonymous" is used

Server

To run as a console application

  1. java Server
  2. java Server portNumber If the port number is not specified 1500 is used

Chat

While in client console:

  1. Simply type the message to send broadcast to all active clients
  2. Type '@usernameyourmessage' without quotes to send message to desired client
  3. Type 'WHOISIN' without quotes to see list of active clients
  4. Type 'LOGOUT' without quotes to logoff from server

chat-server's People

Contributors

abhi195 avatar

Watchers

James Cloos avatar Enya Emmanuel 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.