Skip to content

rajdama/cli-chat-tcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCP CLI Group Chat (Go)

A lightweight TCP-based command-line group chat application built with Go, designed to demonstrate low-level networking, concurrency, and scalable client handling using goroutines and channels.


🚀 Overview

This project implements a multi-client chat server over raw TCP sockets. Users can connect via terminal clients, set usernames, join chat rooms, and exchange messages in real time. Each chat room is handled independently, ensuring smooth communication across multiple users simultaneously.


✨ Features

  • TCP socket–based client-server architecture
  • Command-driven interface
  • Multiple chat rooms support
  • Concurrent client handling using goroutines
  • Channel-based message processing
  • Lightweight and minimal dependencies

🛠️ Tech Stack

  • Language: Go
  • Networking: Native TCP sockets
  • Concurrency: Goroutines & Channels

📜 Commands

Command Description
/nick <name> Set your username
/join <room> Join or create a chat room
/rooms List available chat rooms
/msg <message> Send message to current room
/quit Disconnect from server

⚙️ How It Works

  1. The server listens for incoming TCP connections.
  2. Each connected client is handled in its own goroutine.
  3. Commands are parsed and processed via channels.
  4. Chat rooms maintain their own client lists.
  5. Messages are broadcast only to members of the same room.

▶️ Getting Started

Prerequisites

  • Go installed (v1.18+ recommended)

Run Server

go run server.go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages