{"id":28749093,"url":"https://github.com/dscmatter/winsockcomm","last_synced_at":"2026-05-14T13:40:58.970Z","repository":{"id":297342955,"uuid":"996466414","full_name":"DSCmatter/WinsockComm","owner":"DSCmatter","description":"Demonstrates a basic TCP client-server communication setup using the Winsock API on Windows. ","archived":false,"fork":false,"pushed_at":"2025-06-05T07:11:53.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-16T19:53:48.610Z","etag":null,"topics":["cpp","network-programming","network-security","networking","windows","winsock2"],"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/DSCmatter.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,"zenodo":null}},"created_at":"2025-06-05T01:54:20.000Z","updated_at":"2025-06-05T07:11:54.000Z","dependencies_parsed_at":"2025-06-05T08:29:11.212Z","dependency_job_id":null,"html_url":"https://github.com/DSCmatter/WinsockComm","commit_stats":null,"previous_names":["dscmatter/tcp-client-server-using-winsock","dscmatter/winsockcomm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DSCmatter/WinsockComm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSCmatter%2FWinsockComm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSCmatter%2FWinsockComm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSCmatter%2FWinsockComm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSCmatter%2FWinsockComm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DSCmatter","download_url":"https://codeload.github.com/DSCmatter/WinsockComm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSCmatter%2FWinsockComm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272233457,"owners_count":24896819,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","network-programming","network-security","networking","windows","winsock2"],"created_at":"2025-06-16T19:40:06.599Z","updated_at":"2026-05-14T13:40:53.926Z","avatar_url":"https://github.com/DSCmatter.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WinsockComm\n\nDemonstrates a basic TCP client-server communication setup using the Winsock API on Windows. It includes functionality for secure port binding using `SO_EXCLUSIVEADDRUSE`.\n\n## Features\n\n* TCP client and server using Winsock2\n* Secure port binding with `SO_EXCLUSIVEADDRUSE`\n* Simple echo server: sends back received messages\n\n## Files\n\n* `server.cpp`: Sets up a TCP server that listens on a specified port, accepts client connections, and echoes back received messages.\n* `client.cpp`: Connects to the server, sends a message, and prints the response.\n\n## How to Build\n\n### Prerequisites\n\n* Windows OS (Done on Windows 11 64-bit)\n* MinGW for compilation\n\n### Compile:\n\n```sh\ng++ server.cpp -o server.exe -lws2_32\ng++ client.cpp -o client.exe -lws2_32\n```\n\n## How to Run\n\n### Run Server\n\n```bash\n\\.server.exe\n```\n\nThis starts the server and begins listening for incoming connections on port 27015.\n\n### Run Client\n\n```bash\n\\.client.exe localhost\n```\n\nThis connects to the server running on localhost and sends a test message.\n\n### Input: \"hello\" // from client.cpp\n\n### Output:\n```\nBytes Sent: 5\nBytes received: 5\nConnection closed\n```\n\n## Security\n\n### Port Binding\n\nThe server uses the `SO_EXCLUSIVEADDRUSE` socket option to prevent other applications from binding to the same port while the server is running.\n\n### Communication\n\nCurrently, the communication is done over plain TCP. \n\n## License\n\nThis project is for educational purposes and is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdscmatter%2Fwinsockcomm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdscmatter%2Fwinsockcomm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdscmatter%2Fwinsockcomm/lists"}