Cocoaasyncsocket

Asynchronous socket networking library for Mac and iOS
Alternatives To Cocoaasyncsocket
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Cocoaasyncsocket12,340
1,5572 months ago18August 15, 20204otherObjective-C
Asynchronous socket networking library for Mac and iOS
Hp Socket5,29911a month ago1September 25, 201723otherC
High Performance TCP/UDP/HTTP Communication Component
Cellnet3,87879 months ago3March 11, 20218mitGo
High performance, simple, extensible golang open source network library
Bluesocket1,319
23a year ago94October 05, 202231apache-2.0Swift
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.
Gsocket1,218
13 hours ago18bsd-2-clauseC
Connect like there is no firewall. Securely.
Bedrockframework914
9 months ago2March 26, 202257mitC#
High performance, low level networking APIs for building custom servers and clients.
Zsocket791
3 years agoMay 31, 20216mitGo
Zero-copy sockets for Linux in Golang
Libsocket732
15 days ago21otherC++
The ultimate socket library for C and C++, supporting TCP, UDP and Unix sockets (DGRAM and STREAM) on Linux, FreeBSD, Solaris. Only ZMQ is better. Developer's documentation:
Ezyfox Server495111 days ago14October 01, 20222apache-2.0Java
A socket server (include SSL) supports realtime application, realtime game, MMORPG, messaging, chat and streaming data with TCP, UDP and Websocket
Zig Network325
3 days ago13mitZig
A smallest-common-subset of socket functions for crossplatform networking, TCP & UDP
Alternatives To Cocoaasyncsocket
Select To Compare


Alternative Project Comparisons
Readme

CocoaAsyncSocket

Build Status Version Status Carthage compatible Platform license Public Domain

CocoaAsyncSocket provides easy-to-use and powerful asynchronous socket libraries for macOS, iOS, and tvOS. The classes are described below.

Installation

CocoaPods

Install using CocoaPods by adding this line to your Podfile:

use_frameworks! # Add this if you are targeting iOS 8+ or using Swift
pod 'CocoaAsyncSocket'  

Carthage

CocoaAsyncSocket is Carthage compatible. To include it add the following line to your Cartfile

github "robbiehanson/CocoaAsyncSocket" "master"

The project is currently configured to build for iOS, tvOS and Mac. After building with carthage the resultant frameworks will be stored in:

  • Carthage/Build/iOS/CocoaAsyncSocket.framework
  • Carthage/Build/tvOS/CocoaAsyncSocket.framework
  • Carthage/Build/Mac/CocoaAsyncSocket.framework

Select the correct framework(s) and drag it into your project.

Swift Package Manager

Simply add the package dependency to your Package.swift and depend on "CocoaAsyncSocket" in the necessary targets:

dependencies: [
    .package(url: "https://github.com/robbiehanson/CocoaAsyncSocket", from: "7.6.4")
]

Manual

You 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.

Importing

Using Objective-C:

// When using Clang Modules:
@import CocoaAsyncSocket; 

// or when not:
#import "GCDAsyncSocket.h" // for TCP
#import "GCDAsyncUdpSocket.h" // for UDP

Using Swift:

import CocoaAsyncSocket

TCP

GCDAsyncSocket is a TCP/IP socket networking library built atop Grand Central Dispatch. Here are the key features available:

  • Native Objective-C, fully self-contained in one class.
    No need to muck around with sockets or streams. This class handles everything for you.

  • Full delegate support
    Errors, connections, read completions, write completions, progress, and disconnections all result in a call to your delegate method.

  • Queued non-blocking reads and writes, with optional timeouts.
    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.

  • Automatic socket acceptance.
    Spin up a server socket, tell it to accept connections, and it will call you with new instances of itself for each connection.

  • Support for TCP streams over IPv4 and IPv6.
    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.

  • Support for TLS / SSL
    Secure your socket with ease using just a single method call. Available for both client and server sockets.

  • Fully GCD based and Thread-Safe
    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.

UDP

GCDAsyncUdpSocket is a UDP/IP socket networking library built atop Grand Central Dispatch. Here are the key features available:

  • Native Objective-C, fully self-contained in one class.
    No need to muck around with low-level sockets. This class handles everything for you.

  • Full delegate support.
    Errors, send completions, receive completions, and disconnections all result in a call to your delegate method.

  • Queued non-blocking send and receive operations, with optional timeouts.
    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.

  • Support for IPv4 and IPv6.
    Automatically send/recv using IPv4 and/or IPv6. No more worrying about multiple sockets.

  • Fully GCD based and Thread-Safe
    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.


For those new(ish) to networking, it's recommended you read the wiki.
Sockets might not work exactly like you think they do...

Still got questions? Try the CocoaAsyncSocket Mailing List.


Love the project? Wanna buy me a   ? (or a    ):

donation-bitcoin donation-paypal

Popular Networking Projects
Popular Socket Projects
Popular Networking Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Objective C
Socket
Networking
Completion
Gcd