{"id":29027010,"url":"https://github.com/mshirazkamran/client-server-chatroom-cn","last_synced_at":"2026-05-02T05:05:41.621Z","repository":{"id":298690319,"uuid":"1000776776","full_name":"mshirazkamran/client-server-chatroom-CN","owner":"mshirazkamran","description":"This is my Computer Networks project that uses classes from  java.net and java.io package to implement chatroom the functionality.  ","archived":false,"fork":false,"pushed_at":"2025-06-12T10:14:35.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-12T11:28:09.476Z","etag":null,"topics":["ip","java","java21","java22","java23","javaio","port","socket-io","socket-programming","tcp","tcp-client","tcp-server","tcp-socket"],"latest_commit_sha":null,"homepage":"","language":"Java","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/mshirazkamran.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-06-12T09:56:26.000Z","updated_at":"2025-06-12T10:14:39.000Z","dependencies_parsed_at":"2025-06-12T11:28:17.796Z","dependency_job_id":"607f4f4c-c424-47d6-a05a-244259301fb4","html_url":"https://github.com/mshirazkamran/client-server-chatroom-CN","commit_stats":null,"previous_names":["mshirazkamran/client-server-chatroom-cn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mshirazkamran/client-server-chatroom-CN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshirazkamran%2Fclient-server-chatroom-CN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshirazkamran%2Fclient-server-chatroom-CN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshirazkamran%2Fclient-server-chatroom-CN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshirazkamran%2Fclient-server-chatroom-CN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mshirazkamran","download_url":"https://codeload.github.com/mshirazkamran/client-server-chatroom-CN/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshirazkamran%2Fclient-server-chatroom-CN/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262010798,"owners_count":23244409,"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":["ip","java","java21","java22","java23","javaio","port","socket-io","socket-programming","tcp","tcp-client","tcp-server","tcp-socket"],"created_at":"2025-06-26T06:01:52.975Z","updated_at":"2026-05-02T05:05:41.576Z","avatar_url":"https://github.com/mshirazkamran.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Socket Chat Application (Multi-Client Server)\n\n### 🧑‍💻 Subject: Computer Networks  \n### 📁 Project Title: Multi-Client Chat using TCP Sockets in Java\n\n---\n\n## 📄 Project Overview\n\nThis project demonstrates how socket programming works in Java. It allows multiple clients to connect to a server and communicate with each other in real-time. Each client runs on a separate thread, and all messages are broadcast to other connected users.\n\nThe project uses:\n\n- **TCP/IP sockets**\n- **Multithreading**\n- **Buffered Streams**\n- A custom class `ClientModeller` to manage client info\n\n---\n\n## 📂 File Structure\n\n| File Name            | Description                                      |\n|----------------------|--------------------------------------------------|\n| `Server.java`        | Main server program to accept and handle clients |\n| `Client.java`        | Simple command-line client to connect to server  |\n| `ClientModeller.java`| Class to model each client with streams and name |\n\n---\n\n## ⚙️ How It Works\n\n1. Server runs on port `1234`.\n2. Clients connect to the server and enter their names.\n3. Each client is handled in its own thread.\n4. Messages sent by a client are broadcast to all others.\n\n---\n\n## ▶️ How to Run\n\n1. **Compile all files**\n   ```bash\n   javac Server.java Client.java ClientModeller.java\n   ```\n\n2. **Start the server**\n   ```bash\n   java Server\n   ```\n\n3. **Start one or more clients (in separate terminals)**\n   ```bash\n   java Client\n   ```\n\n---\n\n## 💬 Example Output\n\n**Server**\n```\nServer started on port 1234\nNew client connected: /127.0.0.1\nShiraz joined the chat.\nAhmed joined the chat.\n```\n\n**Client 1 (Alice)**\n```\nEnter your name:\nShiraz\nAhmed has joined the chat.\nAhmed: Hello everyone!\n```\n\n**Client 2 (Bob)**\n```\nEnter your name:\nAhmed\nShiraz: Salam Ahmed!\n```\n\n---\n\n## 📘 Concepts Used\n\n- Java Socket API (TCP)\n- Multi-threading for concurrent client handling\n- Buffered I/O Streams\n- Object-oriented design using helper class (`ClientModeller`)\n\n---\n\n## 🔐 Note\n\nThis is a basic educational-level project. Advanced features like authentication, encryption, error handling, and GUI are not included but can be added later for improvement.\n\n---\n\n_This project was created for the Computer Networks course to understand how client-server communication works using Java sockets._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmshirazkamran%2Fclient-server-chatroom-cn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmshirazkamran%2Fclient-server-chatroom-cn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmshirazkamran%2Fclient-server-chatroom-cn/lists"}