{"id":28938220,"url":"https://github.com/adrijadastidar/cpp-chat","last_synced_at":"2025-10-20T12:56:09.889Z","repository":{"id":290092644,"uuid":"973351699","full_name":"AdrijaDastidar/Cpp-Chat","owner":"AdrijaDastidar","description":"This project demonstrates a simple chat application using TCP sockets in C++ with the Windows Socket API (Winsock). The application consists of two components: the Client and the Server. The client connects to the server, and both parties can send and receive messages in real-time.","archived":false,"fork":false,"pushed_at":"2025-05-06T10:44:29.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T11:52:34.169Z","etag":null,"topics":["chat-application","cpp","tcp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdrijaDastidar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-26T19:54:41.000Z","updated_at":"2025-05-06T10:45:13.000Z","dependencies_parsed_at":"2025-04-26T20:41:22.275Z","dependency_job_id":null,"html_url":"https://github.com/AdrijaDastidar/Cpp-Chat","commit_stats":null,"previous_names":["adrijadastidar/cpp-chat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AdrijaDastidar/Cpp-Chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrijaDastidar%2FCpp-Chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrijaDastidar%2FCpp-Chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrijaDastidar%2FCpp-Chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrijaDastidar%2FCpp-Chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdrijaDastidar","download_url":"https://codeload.github.com/AdrijaDastidar/Cpp-Chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrijaDastidar%2FCpp-Chat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261374428,"owners_count":23148978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat-application","cpp","tcp"],"created_at":"2025-06-22T22:07:41.061Z","updated_at":"2025-10-20T12:56:09.846Z","avatar_url":"https://github.com/AdrijaDastidar.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌐 **C++ TCP Chat Application** 💬\n\nThis project demonstrates a simple chat application using **TCP sockets** in **C++** with the **Windows Socket API (Winsock)**. The application consists of two components: the **Client** and the **Server**. The client connects to the server, and both parties can send and receive messages in real-time.\n\n---\n\n## 🖥️ **Requirements**\n\n- **Windows OS**: The application uses the Winsock API, which is specific to Windows.\n- **Microsoft Visual Studio** or any C++ compiler that supports Winsock (e.g., MinGW with the necessary libraries).\n- **Port 1000** must be open for both client and server communication.\n\n---\n\n## 🚀 **Project Files**\n\n- `Client.cpp`: A console-based client application that connects to the server.\n- `Server.cpp`: A console-based server application that listens for incoming connections and communicates with the client.\n\n---\n\n## ✨ **Features**\n\n- 🖧 **Server**: Listens for incoming connections on port 1000 and can handle one client at a time.\n- 💻 **Client**: Connects to the server on `127.0.0.1` (localhost) and allows the user to send and receive messages.\n- 💬 **Communication**: Uses a simple text-based communication where the user can send a message and receive a response in real-time.\n- 🚪 **Exit Command**: Both client and server can close the connection and shut down the application by typing `exit`.\n\n---\n\n## 🛠️ **Setup**\n\n1. **Compile and Build:**\n   - Open both `Client.cpp` and `Server.cpp` in your preferred C++ IDE (e.g., Microsoft Visual Studio) or compiler.\n   - Make sure that you link against `ws2_32.lib` (the Winsock library) to use the Winsock functions.\n   - Ensure that your compiler supports Winsock (typically available on Windows platforms).\n   \n2. **Run the Server:**\n   - Compile and run the `Server.cpp` file first.\n   - The server will start listening on port 1000 and will wait for a connection.\n\n3. **Run the Client:**\n   - Compile and run the `Client.cpp` file after the server is running.\n   - The client will connect to the server, and both parties can start chatting.\n\n---\n\n## 🔧 **How It Works**\n\n### **Server Side:**\n1. Initializes Winsock. 🛠️\n2. Creates a TCP socket using `socket()`. 🌐\n3. Binds the socket to port 1000 and starts listening for incoming connections. 🔊\n4. When a client connects, it accepts the connection and enters a loop to send/receive messages. 📨\n5. Shuts down when the user types `exit`. 🚪\n\n### **Client Side:**\n1. Initializes Winsock. 🛠️\n2. Creates a TCP socket using `socket()`. 🌐\n3. Connects to the server at `127.0.0.1` on port 1000. 🔗\n4. Enters a loop to send messages to the server and receive responses. 📝\n5. Shuts down when the user types `exit`. 🚪\n\n---\n\n## ✨ **Concluding Notes**\n\n* This application only supports communication between **one client** and **one server**.\n* To extend it, you could add:\n\n  * 🌍 **Multi-client support**.\n  * 📁 **File transfers**.\n  * 🔒 **Encryption** for secure communication.\n* You can change the **port number** or **IP address** to connect over a network.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrijadastidar%2Fcpp-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrijadastidar%2Fcpp-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrijadastidar%2Fcpp-chat/lists"}