{"id":13872027,"url":"https://github.com/PureSwift/Socket","last_synced_at":"2025-07-16T01:32:35.947Z","repository":{"id":41828089,"uuid":"431119975","full_name":"PureSwift/Socket","owner":"PureSwift","description":"Swift async/await based socket ","archived":false,"fork":false,"pushed_at":"2024-11-14T17:23:40.000Z","size":167,"stargazers_count":119,"open_issues_count":1,"forks_count":7,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-11-20T04:06:45.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/PureSwift.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}},"created_at":"2021-11-23T13:54:01.000Z","updated_at":"2024-11-17T18:48:30.000Z","dependencies_parsed_at":"2022-08-20T05:21:45.731Z","dependency_job_id":null,"html_url":"https://github.com/PureSwift/Socket","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureSwift%2FSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureSwift%2FSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureSwift%2FSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureSwift%2FSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PureSwift","download_url":"https://codeload.github.com/PureSwift/Socket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226090030,"owners_count":17572114,"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":[],"created_at":"2024-08-05T23:00:32.475Z","updated_at":"2024-11-23T19:31:31.338Z","avatar_url":"https://github.com/PureSwift.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Socket\nSwift async/await based socket library\n\n## Introduction\n\nThis library exposes an idiomatic Swift API for interacting with POSIX sockets via an async/await interface. What makes this library unique (even to the point that Swift NIO is still using a [custom socket / thread pool](https://forums.swift.org/t/swift-5-5-supports-concurrency-is-there-any-change-in-swift-nio/50940/2)) is that it was built exclusively using Swift Concurrency and doesn't use old blocking C APIs, CFSocket, DispatchIO, CFRunloop, GCD, or explicitly create a single thread outside of the Swift's global cooperative thread pool to manage the sockets and polling. \n\nThe result is a Socket API that is optimized for async/await and built from the group up. Additionally, like the System, and Concurrency APIs, the Socket is represented as a `struct` instead of a class, greatly reducing ARC overhead. The internal state for the socket is managed by a singleton that stores both its state, and keeps an array of managed file descriptors so polling is global. \n\n## Goals\n\n- Minimal overhead for Swift Async/Await\n- Minimal ARC overhead, keep state outside of `Socket`\n- Avoid thread explosion and overcomitting the system\n- Use actors to prevent blocking threads\n- Optimize polling and C / System API usage\n- Low energy usage and memory overhead\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPureSwift%2FSocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPureSwift%2FSocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPureSwift%2FSocket/lists"}