Skip to content

A terminal-based chat application in C featuring rooms, nicknames, and real-time communication using sockets.

License

Notifications You must be signed in to change notification settings

felipemdutra/chat-rooms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat Rooms

Overview

This project is a terminal-based chat application built in C. It uses sockets for real-time communication, allowing users to join chat rooms, set nicknames and exchange messages seamlessly.

Features

  • Multiple chat rooms for users to join and interact.

  • Customizable usernames

  • Real-time messaging.

  • Minimalistic terminal-based interface

Requirements

  • A C compiler like GCC

  • Make (if you're using the provided Makefile)

  • A terminal

Installation

Clone the repo

git clone https://github.com/felipemdutra/chat-rooms.git
cd chat-rooms

Build the project

make

Running the application

Start the server

./chat_app
The server will listen on the default port 8080

Simulate a client

Open a new terminal window and type

nc localhost 8080

Open multiple terminal windows to simulate different clients.

List of commands

After running the server and connecting as a client, try the following commands:

  • Set a nickname:
\name <your-nickname>
  • Create a chat room:
\create <room-name>
  • List available rooms:
\list
  • Join a chat room:
\join <room-name>
  • Leave a room:
\leave
  • Send a message:

Type and press Enter.

Known Issues

  • When a client disconnects, the client array doesn't change, causing errors

  • When a room is deleted, the rooms array doesn't change, causing errors

  • When a client leaves a room, the room's clients array does't change, causing errors

About

A terminal-based chat application in C featuring rooms, nicknames, and real-time communication using sockets.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published