{"id":1606,"url":"https://github.com/robbiehanson/CocoaAsyncSocket","last_synced_at":"2025-08-02T04:31:57.028Z","repository":{"id":1900217,"uuid":"2826918","full_name":"robbiehanson/CocoaAsyncSocket","owner":"robbiehanson","description":"Asynchronous socket networking library for Mac and iOS","archived":false,"fork":false,"pushed_at":"2023-07-20T18:49:00.000Z","size":2281,"stargazers_count":12473,"open_issues_count":1,"forks_count":3017,"subscribers_count":528,"default_branch":"master","last_synced_at":"2025-07-28T00:21:10.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robbiehanson.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2011-11-22T10:25:54.000Z","updated_at":"2025-07-23T08:14:31.000Z","dependencies_parsed_at":"2023-07-05T16:00:37.742Z","dependency_job_id":"5083a09b-07e2-48a0-a8ae-7e3a583ace06","html_url":"https://github.com/robbiehanson/CocoaAsyncSocket","commit_stats":{"total_commits":482,"total_committers":64,"mean_commits":7.53125,"dds":0.4232365145228216,"last_synced_commit":"5ddba5e72f38e56010dbfac08b44478ee5000c0c"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/robbiehanson/CocoaAsyncSocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbiehanson%2FCocoaAsyncSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbiehanson%2FCocoaAsyncSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbiehanson%2FCocoaAsyncSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbiehanson%2FCocoaAsyncSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robbiehanson","download_url":"https://codeload.github.com/robbiehanson/CocoaAsyncSocket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbiehanson%2FCocoaAsyncSocket/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267721543,"owners_count":24133760,"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-07-29T02:00:12.549Z","response_time":2574,"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":[],"created_at":"2024-01-05T20:15:51.221Z","updated_at":"2025-08-02T04:31:56.382Z","avatar_url":"https://github.com/robbiehanson.png","language":"Objective-C","readme":"# CocoaAsyncSocket\n[![Build Status](https://travis-ci.org/robbiehanson/CocoaAsyncSocket.svg?branch=master)](https://travis-ci.org/robbiehanson/CocoaAsyncSocket) [![Version Status](https://img.shields.io/cocoapods/v/CocoaAsyncSocket.svg?style=flat)](http://cocoadocs.org/docsets/CocoaAsyncSocket) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Platform](http://img.shields.io/cocoapods/p/CocoaAsyncSocket.svg?style=flat)](http://cocoapods.org/?q=CocoaAsyncSocket) [![license Public Domain](https://img.shields.io/badge/license-Public%20Domain-orange.svg?style=flat)](https://en.wikipedia.org/wiki/Public_domain)\n\n\nCocoaAsyncSocket provides easy-to-use and powerful asynchronous socket libraries for macOS, iOS, and tvOS. The classes are described below.\n\n## Installation\n\n#### CocoaPods\n\nInstall using [CocoaPods](https://cocoapods.org) by adding this line to your Podfile:\n\n````ruby\nuse_frameworks! # Add this if you are targeting iOS 8+ or using Swift\npod 'CocoaAsyncSocket'  \n````\n\n#### Carthage\n\nCocoaAsyncSocket is [Carthage](https://github.com/Carthage/Carthage) compatible. To include it add the following line to your `Cartfile`\n\n```bash\ngithub \"robbiehanson/CocoaAsyncSocket\" \"master\"\n```\n\nThe project is currently configured to build for **iOS**, **tvOS** and **Mac**.  After building with carthage the resultant frameworks will be stored in:\n\n* `Carthage/Build/iOS/CocoaAsyncSocket.framework`\n* `Carthage/Build/tvOS/CocoaAsyncSocket.framework`\n* `Carthage/Build/Mac/CocoaAsyncSocket.framework`\n\nSelect the correct framework(s) and drag it into your project.\n\n#### Swift Package Manager\n\nSimply add the package dependency to your Package.swift and depend on \"CocoaAsyncSocket\" in the necessary targets:\n```swift\ndependencies: [\n    .package(url: \"https://github.com/robbiehanson/CocoaAsyncSocket\", from: \"7.6.4\")\n]\n```\n\n#### Manual\n\nYou can also include it into your project by adding the source files directly, but you should probably be using a dependency manager to keep up to date.\n\n### Importing\n\nUsing Objective-C:\n\n```obj-c\n// When using Clang Modules:\n@import CocoaAsyncSocket; \n\n// or when not:\n#import \"GCDAsyncSocket.h\" // for TCP\n#import \"GCDAsyncUdpSocket.h\" // for UDP\n```\n\nUsing Swift:\n\n```swift\nimport CocoaAsyncSocket\n```\n\n## TCP\n\n**GCDAsyncSocket** is a TCP/IP socket networking library built atop Grand Central Dispatch. Here are the key features available:\n\n- Native Objective-C, fully self-contained in one class.\u003cbr/\u003e\n  _No need to muck around with sockets or streams. This class handles everything for you._\n\n- Full delegate support\u003cbr/\u003e\n  _Errors, connections, read completions, write completions, progress, and disconnections all result in a call to your delegate method._\n\n- Queued non-blocking reads and writes, with optional timeouts.\u003cbr/\u003e\n  _You tell it what to read or write, and it handles everything for you. Queueing, buffering, and searching for termination sequences within the stream - all handled for you automatically._\n\n- Automatic socket acceptance.\u003cbr/\u003e\n  _Spin up a server socket, tell it to accept connections, and it will call you with new instances of itself for each connection._\n\n- Support for TCP streams over IPv4 and IPv6.\u003cbr/\u003e\n  _Automatically connect to IPv4 or IPv6 hosts. Automatically accept incoming connections over both IPv4 and IPv6 with a single instance of this class. No more worrying about multiple sockets._\n\n- Support for TLS / SSL\u003cbr/\u003e\n  _Secure your socket with ease using just a single method call. Available for both client and server sockets._\n\n- Fully GCD based and Thread-Safe\u003cbr/\u003e\n  _It runs entirely within its own GCD dispatch_queue, and is completely thread-safe. Further, the delegate methods are all invoked asynchronously onto a dispatch_queue of your choosing. This means parallel operation of your socket code, and your delegate/processing code._\n\n## UDP\n\n**GCDAsyncUdpSocket** is a UDP/IP socket networking library built atop Grand Central Dispatch. Here are the key features available:\n\n- Native Objective-C, fully self-contained in one class.\u003cbr/\u003e\n  _No need to muck around with low-level sockets. This class handles everything for you._\n\n- Full delegate support.\u003cbr/\u003e\n  _Errors, send completions, receive completions, and disconnections all result in a call to your delegate method._\n\n- Queued non-blocking send and receive operations, with optional timeouts.\u003cbr/\u003e\n  _You tell it what to send or receive, and it handles everything for you. Queueing, buffering, waiting and checking errno - all handled for you automatically._\n\n- Support for IPv4 and IPv6.\u003cbr/\u003e\n  _Automatically send/recv using IPv4 and/or IPv6. No more worrying about multiple sockets._\n\n- Fully GCD based and Thread-Safe\u003cbr/\u003e\n  _It runs entirely within its own GCD dispatch_queue, and is completely thread-safe. Further, the delegate methods are all invoked asynchronously onto a dispatch_queue of your choosing. This means parallel operation of your socket code, and your delegate/processing code._\n\n***\n\nFor those new(ish) to networking, it's recommended you **[read the wiki](https://github.com/robbiehanson/CocoaAsyncSocket/wiki)**.\u003cbr/\u003e_Sockets might not work exactly like you think they do..._\n\n**Still got questions?** Try the **[CocoaAsyncSocket Mailing List](https://groups.google.com/group/cocoaasyncsocket)**.\n***\n\nLove the project? Wanna buy me a ☕️\u0026nbsp;\u0026nbsp;? (or a 🍺\u0026nbsp;\u0026nbsp;😀\u0026nbsp;):\n\n[![donation-bitcoin](https://bitpay.com/img/donate-sm.png)](https://onename.com/robbiehanson)\n[![donation-paypal](https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2M8C699FQ8AW2)\n\n","funding_links":["https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2M8C699FQ8AW2"],"categories":["Networking","Objective-C","Objective-C  Stars 1000以内排名整理","Major","etc","iOS","**Index**","Socket"],"sub_categories":["Video","Other free courses","Network","Socket","First, the gold standard libraries. The essentials --- You **NEED** to know about these !! You're likely to include a few of these in your own iOS projects"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobbiehanson%2FCocoaAsyncSocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobbiehanson%2FCocoaAsyncSocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobbiehanson%2FCocoaAsyncSocket/lists"}