{"id":21477751,"url":"https://github.com/goldenreynard/tcp_server","last_synced_at":"2025-03-17T08:22:09.370Z","repository":{"id":234147483,"uuid":"631123684","full_name":"goldenreynard/tcp_server","owner":"goldenreynard","description":"Making a TCP server which is multithreaded and can do Parallel Processing","archived":false,"fork":false,"pushed_at":"2023-04-22T02:25:48.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T17:55:22.346Z","etag":null,"topics":["golang","multithreading","server","tcp-server"],"latest_commit_sha":null,"homepage":"","language":"Go","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/goldenreynard.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}},"created_at":"2023-04-22T02:23:11.000Z","updated_at":"2023-04-22T02:27:04.000Z","dependencies_parsed_at":"2024-04-18T10:20:47.066Z","dependency_job_id":"6b5fc035-7f81-44a0-925b-9cfc9b700fd3","html_url":"https://github.com/goldenreynard/tcp_server","commit_stats":null,"previous_names":["goldenreynard/tcp_server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenreynard%2Ftcp_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenreynard%2Ftcp_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenreynard%2Ftcp_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenreynard%2Ftcp_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goldenreynard","download_url":"https://codeload.github.com/goldenreynard/tcp_server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997170,"owners_count":20380981,"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":["golang","multithreading","server","tcp-server"],"created_at":"2024-11-23T11:14:59.846Z","updated_at":"2025-03-17T08:22:09.339Z","avatar_url":"https://github.com/goldenreynard.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TCP Server made using Go\n\n- TCP is the most reliable way for two machines to talk to each other over the network.\n- TCP servers are designed to handle and serve multiple TCP connections.\n- A TCP server is a simple process that runs on a machine and listens to a port that understands TCP.\n\n## First Part: Accepting a single request \n\n- First block the port: 1729 for the connection\n- Made the connection open\n- Make the do function which \n  - Accepts the request\n  - Read the connection string\n  - Process the Request\n  - Write back to the server\n  - Close the request\n\n---\n\n## Accepting Multiple Request - Single threaded\n\n- Built on the top of the first request\n- We Made the connection to run infinitely using the for loop\n- Can accept the multiple request\n- First Process the first incoming request then when finished move to the next one\n- Single threaded i.e One Request at one time\n\n---\n\n## Multithreading - Parallel Processing\n\n- Accepting multiple request at the same time\n- When accepting the request the function which is responsible for processing the request will go to the other thread\n- Main thread then can process the next incoming request\n- Server can process the multiple request at the same time\n\n\u003e if Large numbers of the request comes then it will be thread overloading which can crash the server limits \n---\n\n## Improvements to the Multithreading\n\n- Limiting the number of threads\n- Connection pooling: fixed time for a client to send the request\n- Making thread Pool i.e Fixed number of the thread available\n- TCP backlog queue configuration i.e how many connection you want in the backlog\n\n\u003e **SOURCE**: [Link](https://www.youtube.com/watch?v=f9gUFy-9uCM)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldenreynard%2Ftcp_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoldenreynard%2Ftcp_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldenreynard%2Ftcp_server/lists"}