{"id":22941402,"url":"https://github.com/bashmocha/multithreaded-tcp-ip-chat-server","last_synced_at":"2025-06-15T00:04:02.044Z","repository":{"id":200118015,"uuid":"704023784","full_name":"BashMocha/multithreaded-tcp-ip-chat-server","owner":"BashMocha","description":"multithreaded server-client application where multiple clients can send text and files via server","archived":false,"fork":false,"pushed_at":"2023-12-12T19:16:10.000Z","size":3376,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T13:13:10.263Z","etag":null,"topics":["multithreading","socket-programming","tcp-ip"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BashMocha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-10-12T11:35:25.000Z","updated_at":"2023-12-12T11:29:33.000Z","dependencies_parsed_at":"2023-11-08T13:44:20.911Z","dependency_job_id":"91d7ea49-3690-45d9-8a5a-20f1e7674f00","html_url":"https://github.com/BashMocha/multithreaded-tcp-ip-chat-server","commit_stats":null,"previous_names":["cheesyfrappe/multiple-client-tcp-ip-server","bashmocha/multithreaded-tcp-ip-chat-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fmultithreaded-tcp-ip-chat-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fmultithreaded-tcp-ip-chat-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fmultithreaded-tcp-ip-chat-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fmultithreaded-tcp-ip-chat-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BashMocha","download_url":"https://codeload.github.com/BashMocha/multithreaded-tcp-ip-chat-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709919,"owners_count":20821298,"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":["multithreading","socket-programming","tcp-ip"],"created_at":"2024-12-14T13:39:24.897Z","updated_at":"2025-04-01T20:44:03.678Z","avatar_url":"https://github.com/BashMocha.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TCP/IP Classroom Server\r\n\u003e Multithreaded server-client application where multiple clients can send text and files via server\r\n\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![Environment: Ubuntu](https://img.shields.io/badge/Environment-Ubuntu-orange)](https://ubuntu.com/)\r\n \r\n\u003cdiv align=\"center\"\u003e\r\n    \u003cimg src=\"https://github.com/CheesyFrappe/multithreaded-tcp-ip-chat-server/assets/80858788/4ec86731-aec1-4898-88a1-ba93e8fa4412\"/\u003e\r\n\u003c/div\u003e\u003cbe\u003e\r\n\r\n---\r\n\r\n### Table of contents\r\n- [Introduction](#introduction)\r\n- [Features](#features)\r\n- [Prerequisities](#prerequisities)\r\n- [Usage](#usage)\r\n\r\n# Introduction\r\nThe project aims to help students to develop the idea of how client-server applications run and communicate. It's a simple implementation of server-client architecture that aims to simulate a classroom using TCP-IP protocol. \r\nWhere students are able to join a server within the same port that the server uses, send texts to each other, ask/answer questions, and send/receive files. \r\n\r\n# Features\r\n- The whole implementation runs under TCP/IP protocol and on `localhost`.\r\n- Server supports multi-clients up to 30. This can be modified via `MAX_CLIENT_NUM` in `util.h`.\r\n- Server supports database functionality with SQLite3. Check out the [Prerequisities](#prerequisities).\r\n- Server takes time for timeout. During the inactivity of 10 minutes, the server shuts itself. This can be modified via `TIMEOUT` in `util.h`.\r\n- The packet size is 1 kilobyte. This can be modified via `BUFF_SIZE` in `util.h`.\r\n- Each client supports multithreading for receiving and sending packets simultaneously.\r\n- Students can send texts to each other through the server. This can also be mentioned as broadcasting.\r\n- Students can ask, answer, and list all questions with defined commands. Check out the [Usage](#usage).\r\n- Students can transfer and list files through the server with defined commands. Check out the [Usage](#usage).\r\n- Students can list all current users on the server. The server keeps a list of active users in the database.\r\n\r\n# Prerequisities\r\n\u003e [!IMPORTANT]\r\n\u003e The project was written/tested on Ubuntu/Linux. Some of the libraries are only compatible with Unix-like\r\n\u003e operating systems. Therefore, it does not run on Windows.\r\n\r\n### SQLite3\r\nTo install from the command line:\r\n```shell\r\n  sudo apt install sqlite3\r\n```\r\nTo verify the installation, check the software’s version:\r\n```shell\r\n  sqlite3 --version\r\n```\r\nOr you can check the official [Downloads](https://www.sqlite.org/download.html) page to install the source code.\r\n\r\n# Usage\r\n\u003e [!WARNING]\r\n\u003e The whole project runs on `localhost` and has not been tested on distinct machines.\r\n\u003e Trying to run the server and clients on different machines can cause fatal errors and crash the program entirely.\r\n\r\n\u003e [!WARNING]\r\n\u003e `./bin`, `./bin/local` and `./bin/remote` folders are crucial for the project functionality\r\n\u003e especially for the database and file transfer functions.\r\n\u003e Do not modify, edit, or delete `bin` and its sub-folders.\r\n\r\nTo install and build the project:\r\n```shell\r\n  git clone https://github.com/CheesyFrappe/multithreaded-tcp-ip-chat-server.git\r\n  cd multithreaded-tcp-ip-chat-server/src\r\n  make\r\n```\r\nRun server on bin directory:\r\n```shell\r\n  cd bin\r\n  ./server\r\n```\r\nRun client(s) on bin directory:\r\n```shell\r\n  cd bin\r\n  ./client\r\n```\r\n\u003cbr\u003e\r\nThere are several defined commands for the utilities. Each of the commands is described below:\r\n\r\n- use `help` to list all command descriptions during the session.\r\n- use `quit` to exit from the application.\r\n- use `ASK` to ask a question.\r\n```shell\r\n  ASK who is the first king of Portugal?  \r\n```\r\n- use `ANSWER` to answer a question.\r\n```shell\r\n  ANSWER it is Afonso I  \r\n```\r\n- use `LISTQUESTIONS` to list all questions.\r\n```shell\r\n  LISTQUESTIONS\r\n\r\n  (1) who is the first king of Portugal?\r\n      Afonso I\r\n\r\n  ENDQUESTIONS \r\n```\r\n- use `PUTFILE` to upload a file to the server from `bin/local` folder.\r\n```shell\r\n  PUTFILE 1.jpeg\r\n  [+]Uploaded ./local/1.jpeg 111817  \r\n```\r\n- use `GETFILE` to download a file from the server to `bin/local` folder.\r\n```shell\r\n  GETFILE 1.jpeg\r\n  [+]FILE ./local/1.jpeg 111817  \r\n```\r\n- use `LISTFILES` to list all files held by the server.\r\n```shell\r\n  LISTFILES\r\n\r\n  (1) 1.jpeg\r\n\r\n  (2) operating_systems.pdf\r\n\r\n  ENDFILES\r\n```\r\n- use `LISTUSERS` to list all active users on the server.\r\n```shell\r\n  LISTUSERS\r\n\r\n  (1) emir\r\n\r\n  (2) miguel\r\n\r\n  ENDUSERS \r\n```\r\n\u003cbr\u003e\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashmocha%2Fmultithreaded-tcp-ip-chat-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbashmocha%2Fmultithreaded-tcp-ip-chat-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashmocha%2Fmultithreaded-tcp-ip-chat-server/lists"}