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.
- Unix based system
- Java installed
- Clone the repo
- Run make in the given directory
- This will compile the given Server.java file into an executable
- To run the Server, type ./server -p PortNumber to bind the server executable to a port
- For users, use the given executable client file by running ./client . You can then connect the client to a server and run commands
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:
- \connect IP Address:Port = Instruct the client to connect to a new chat server,specified by the IP address and port.
- \disconnect = If connected to a server, disconnect from that server.
- \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.
- \leave = If in a room, this exits the room. Otherwise, it leaves the server.
- \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.
- \list rooms = List all rooms that currently exist on the server.
- \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.
- \nick Name = Set your nickname to the specified name. Name must be less than 256 characters in length.
- \quit = Disconnect the session and exit the program.