Skip to content

Latest commit

 

History

History
33 lines (29 loc) · 2.43 KB

README.md

File metadata and controls

33 lines (29 loc) · 2.43 KB

ChatRoom

This is a Chat Server written in Java. It alows users to communicate with one another by connecting to the server and interacting with it in accordance to an application protocol.
Through this protocol, the server allows clients to engage in group chats in chat rooms and send private messages to one another.
The Server uses Socket programming to handle client communication and multi threading to handle concurrent client connections.

Prerequisites

  1. Unix based system
  2. Java installed

How to run

  1. Clone the repo
  2. Run make in the given directory
  3. This will compile the given Server.java file into an executable
  4. To run the Server, type ./server -p PortNumber to bind the server executable to a port
  5. For users, use the given executable client file by running ./client . You can then connect the client to a server and run commands

Features supported by client

While running, the client takes commands directly from the user. All commands are preceded by a backslash. Not every command is available in every context. The client supports the following commands:

  1. \connect IP Address:Port = Instruct the client to connect to a new chat server,specified by the IP address and port.
  2. \disconnect = If connected to a server, disconnect from that server.
  3. \join Room Password = Join the specified chatroom, creating it if it does not already exist. The Password is optional, with the default being the empty string. Users may only join rooms for which they know the password. Both Room and Password must be less than 256 characters in length.
  4. \leave = If in a room, this exits the room. Otherwise, it leaves the server.
  5. \list users = List all users. If in a room, it lists all users in that room. Otherwise, it lists all users connected to the server.
  6. \list rooms = List all rooms that currently exist on the server.
  7. \msg User Message = Send a private message to the specified user. User must beless than 256 characters in length and the Message must be less than 65536 characters in length.
  8. \nick Name = Set your nickname to the specified name. Name must be less than 256 characters in length.
  9. \quit = Disconnect the session and exit the program.