Asynchronous socket networking library for Mac and iOS

Overview

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

Comments
  • IPv6 Can't assign requested address

    IPv6 Can't assign requested address

    As Apple says, tried to connect to IPv4 address in IPv6-only network, here are codes:

    GCDAsyncSocket *socket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
    socket.IPv4PreferredOverIPv6 = NO;
    [socket connectToHost:@"xxx.xxx.xxx.xxx" onPort:xxx withTimeout:10 error:nil];
    

    Always failed with error: Error Domain=NSPOSIXErrorDomain Code=49 "Can't assign requested address" UserInfo={NSLocalizedDescription=Can't assign requested address, NSLocalizedFailureReason=Error in connect() function}

    I thought CocoaAsyncSocket will Synthesize IPv6 address from IPv4 address automatically, but I was wrong. Can somebody help me?

    no-issue-activity 
    opened by Smeegol 39
  • Crash on iOS 15.0 Beta5 +[GCDAsyncSocket cfstreamThread] (GCDAsyncSocket.m:7596)

    Crash on iOS 15.0 Beta5 +[GCDAsyncSocket cfstreamThread] (GCDAsyncSocket.m:7596)

    I have this crash on iOS 15.0 Beta5.The crash happened on the method +[GCDAsyncSocket cfstreamThread] line:7596. What could be the cause of the problem?

    This is the crash stack:

    Thread 32 name: GCDAsyncSocket-CFStream Thread 32 Crashed: 0 libobjc.A.dylib 0x19b483c50 objc_release + 16 1 Foundation 0x184161344 -[_NSThreadPerformInfo dealloc] + 56 2 Foundation 0x1842d08dc __NSThreadPerform + 160 3 CoreFoundation 0x1829b069c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 4 CoreFoundation 0x1829c12f0 __CFRunLoopDoSource0 + 208 5 CoreFoundation 0x1828fabf8 __CFRunLoopDoSources0 + 268 6 CoreFoundation 0x182900404 __CFRunLoopRun + 820 7 CoreFoundation 0x182913fc8 CFRunLoopRunSpecific + 600 8 Foundation 0x184134104 -[NSRunLoop+ 102660 (NSRunLoop) runMode:beforeDate:] + 236 9 MyApp 0x104990290 0x1026b0000 + 36569744 10 Foundation 0x184183950 NSThread__start + 764 11 libsystem_pthread.dylib 0x1f2745a60 _pthread_start + 148 12 libsystem_pthread.dylib 0x1f2744f5c thread_start + 8

    no-issue-activity 
    opened by xgycc 29
  • just crash on ios 15.1.0

    just crash on ios 15.1.0

    Crashed: GCDAsyncSocket-CFStream EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 0 libobjc.A.dylib lookUpImpOrForward + 76 1 libobjc.A.dylib _objc_msgSend_uncached + 68 2 Foundation -[_NSThreadPerformInfo dealloc] + 56 3 Foundation __NSThreadPerformPerform + 240 4 CoreFoundation CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 5 CoreFoundation __CFRunLoopDoSource0 + 208 6 CoreFoundation __CFRunLoopDoSources0 + 268 7 CoreFoundation __CFRunLoopRun + 820 8 CoreFoundation CFRunLoopRunSpecific + 600 9 Foundation -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 10 MeMe GCDAsyncSocket.m - Line 7686 +[GCDAsyncSocket cfstreamThread:] + 7686 11 Foundation NSThread__start + 808 12 libsystem_pthread.dylib _pthread_start + 148 13 libsystem_pthread.dylib thread_start + 8

    a lot of people crashed,and just crash on ios 15.1.0

    no-issue-activity 
    opened by fallbort 28
  • socketDidDisconnectWithError not getting called if socket is disconnected by other party after a write?

    socketDidDisconnectWithError not getting called if socket is disconnected by other party after a write?

    socketDidDisconnectWithError not getting called if socket is disconnected by other party after a write?

    If I write something in socket and then the other party disconnects no callback function is there..

    If there is no write then I get a callback?

    opened by kneeraj1762 28
  • kCFStreamNetworkServiceTypeVoIP is deprecated in iOS 9.0

    kCFStreamNetworkServiceTypeVoIP is deprecated in iOS 9.0

    To whom it may concern,

    I got the following warning message when upgrading to Xcode 7.0 and the development target 9.0.

    'kCFStreamNetworkServiceTypeVoIP' is deprecated: first deprecated in iOS 9.0 - use PushKit for VoIP control purposes" in GCDAsyncSocket.m

    Please let me know if you need more detail to resolve this issue.

    Thank you for precious time on this.

    TCP GCD Feature request Question More info needed no-issue-activity 
    opened by willSapgreen 25
  • Added support for unix domain sockets

    Added support for unix domain sockets

    Feature request #76. This is only implemented for GCDAsyncSocket.

    Xcode/DomainTest/ demonstrates the use of unix domain sockets as a server and a client.

    I tried to implement this feature with as little overall changes to the code as possible, which has yielded some additional code replication.

    opened by jdiehl 21
  • possible memory leak ios 9.0.2

    possible memory leak ios 9.0.2

    Sending messages with a GCDAsyncUdpSocket in an iOS app (SpriteKit), makes the Memory indicator in the debugging sidebar in XCode go up and never comes down ( I reached 500+ MB at one time after a lot of usage, and the app only starts with 10 MB). I did not manage to find where the leak comes from with Instruments , but by trial and error, I managed to figure out it only happen when I send a message

    My code [_clientSocket sendData:data toHost:host port:port withTimeout:-1 tag:1];

    Which goes to GDCAsyncUdpSocket.m:

    • (void)sendData:(NSData *)data toHost:(NSString *)host port:(uint16_t)port withTimeout:(NSTimeInterval)timeout tag:(long)tag

    Tested with an iphone 6 / ios 9.0.2. A thing to note, the leak does not seem to be happening on an iPhone4 / iOS 7.

    opened by eemerge 20
  • Implement Happy Eyeballs algorithm (IPv4 / IPv6 connectivity)

    Implement Happy Eyeballs algorithm (IPv4 / IPv6 connectivity)

    Currently GCDAsyncSocket resolves hosts to addresses (DNS) automatically, but doesn't choose the right protocol (IPv4 or IPv6). Indeed, some hostnames have both A and AAAA records, and interfaces support IPv4 and IPv6, so we have choice to connect with either protocols. Though, sometimes servers listens only one of both protocols even if A and AAAA records are present. e.g. this is the case of the local PHP server (when running php -S) that listens on IPv6 only, even if localhost has both IPv4 and IPv6 host records. This causes a problem as we don't know which protocol to use ahead of time, and need to try to connect with either protocol and then try the other if the first fails. This can be done manually using IPv4Enabled, IPv6Enabled and IPv4PreferredOverIPv6, but I think this could be nicely handled by the library as it isn't a simple problem for applications.

    I don't have any deep knowledge of IP protocols nor dual-stack applications, but it seems that the Happy Eyeballs algorithm is the answer, see RFC 6555.

    (note: I need to solve that problem for my app, so I'll try to come up with a solid implementation and do a PR)

    Feature request no-issue-activity 
    opened by mittsh 16
  • socketDidDisconnect  not to be call on iOS6

    socketDidDisconnect not to be call on iOS6

    It always be called on iOS5,but when I test it on iOS6 ,it doesn't work. I tried connect to a TCP sever using GCDAsyncSocket,when I stop sharing Internet over WIFI,I found CFReadStreamCallback and CFWriteStreamCallback not to be call.There is not any error event.

    TCP GCD Bug no-issue-activity 
    opened by momor 16
  •  Crash on iOS 14.5 -[GCDAsyncSocket openStreams] (GCDAsyncSocket.m:6998)

    Crash on iOS 14.5 -[GCDAsyncSocket openStreams] (GCDAsyncSocket.m:6998)

    Hi, Apps crashed when became foreground and want to connect with server,since iOS 14.5 released on April 27。

    Crash stack like this:

    Monitor Type: Mach Exception Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010 Crashed Thread: 40

    Pthread id: 867350 Thread 40 Crashed: 0 libnetwork.dylib nw_endpoint_flow_copy_path + 44 1 libnetwork.dylib nw_endpoint_flow_copy_path + 40 2 libnetwork.dylib nw_endpoint_flow_connected + 320 3 libnetwork.dylib nw_flow_connected + 3668 4 libnetwork.dylib nw_socket_connect + 584 5 libnetwork.dylib nw_endpoint_flow_connect + 164 6 libnetwork.dylib nw_endpoint_flow_setup_protocols + 3272 7 libnetwork.dylib -[NWConcrete_nw_endpoint_flow startWithHandler:] + 3616 8 libnetwork.dylib nw_endpoint_handler_path_change + 10592 9 libnetwork.dylib nw_endpoint_handler_start + 1184 10 libnetwork.dylib __nw_connection_start_block_invoke + 1460 11 imeituan __innerBlockOnce_block_invoke (SCRCrashMonitor_GCD.mm:191) 12 libdispatch.dylib _dispatch_call_block_and_release + 32 13 libdispatch.dylib _dispatch_client_callout + 20 14 libdispatch.dylib _dispatch_lane_serial_drain + 620 15 libdispatch.dylib _dispatch_lane_invoke + 456 16 libdispatch.dylib _dispatch_workloop_invoke + 1680 17 libdispatch.dylib _dispatch_workloop_worker_thread + 764 18 libsystem_pthread.dylib _pthread_wqthread + 276 Enqueue thread backtrace: 0 imeituan innerBlockOnce (SCRCrashMonitor_GCD.mm:0) 1 imeituan _dispatch_async (SCRCrashMonitor_GCD.mm:0) 2 libnetwork.dylib nw_connection_start + 280 3 libnetwork.dylib tcp_connection_start + 1496 4 CFNetwork 0x0000000180b7c3bc + 168 5 CFNetwork 0x0000000180b79b80 + 2776 6 CFNetwork 0x0000000180b77918 + 1724 7 CoreFoundation _CFStreamOpen + 140 8 imeituan -[GCDAsyncSocket openStreams] (GCDAsyncSocket.m:6998) 9 imeituan __29-[GCDAsyncSocket didConnect:]_block_invoke330 (GCDAsyncSocket.m:2369) 10 imeituan __29-[GCDAsyncSocket didConnect:]_block_invoke_2 (GCDAsyncSocket.m:2396) 11 imeituan __innerBlockOnce_block_invoke (SCRCrashMonitor_GCD.mm:191) 12 libdispatch.dylib _dispatch_call_block_and_release + 32 13 libdispatch.dylib _dispatch_client_callout + 20 14 libdispatch.dylib _dispatch_lane_serial_drain + 620 15 libdispatch.dylib _dispatch_lane_invoke + 404 16 libdispatch.dylib _dispatch_workloop_worker_thread + 764 17 libsystem_pthread.dylib _pthread_wqthread + 276 18 libsystem_pthread.dylib start_wqthread + 8

    no-issue-activity 
    opened by nihongmei 15
  • nw_connection_copy_connected_path ERROR

    nw_connection_copy_connected_path ERROR

    after connected,I meet this error "[] nw_connection_copy_connected_path [C1] Client called nw_connection_copy_connected_path on unconnected nw_connection" "tcp_connection_is_cellular No connected path",is anybody met this problem?

    no-issue-activity 
    opened by ligui-iOS 15
  • crashed on iOS 16.1, SIGTRAP

    crashed on iOS 16.1, SIGTRAP

    libsystem_platform.dylib 0x1d3d7008c __os_semaphore_wait.cold.1 + 48544 libsystem_platform.dylib 0x1d3d6a898 __os_semaphore_wait.cold.1 + 26028 CoreFoundation 0x186e6d0c0 _CFBagGetValue + 76 CFNetwork 0x188085498 __CFNetworkErrorGetLocalizedDescription + 357868 CoreFoundation 0x186db2c70 ___NSSetM_copy + 24 CFNetwork 0x188063014 __CFNetworkErrorGetLocalizedDescription + 217448 CoreFoundation 0x186e1aa10 ___CFRunLoopDoTimer + 996 CoreFoundation 0x186e6d3f8 __CFXNotificationRegistrarAddName + 800 CFNetwork 0x18806faec __CFNetworkErrorGetLocalizedDescription + 269376 CoreFoundation 0x186ddf5dc ___CFStringAppendFormatCore + 3212 superstar 0x1000fbfd8 -[GCDAsyncSocket closeWithError:] (GCDAsyncSocket.m:3236) superstar 0x100100a08 -[GCDAsyncSocket doReadEOF] (GCDAsyncSocket.m:5719) superstar 0x1000ff0b0 ___66-[GCDAsyncSocket setupReadAndWriteSourcesForNewlyConnectedSocket:]_block_invoke (GCDAsyncSocket.m:4281) libdispatch.dylib 0x18e375fdc __dispatch_channel_invoke + 2896 libdispatch.dylib 0x18e37946c __dispatch_sync_f_slow + 240 libdispatch.dylib 0x18e38ca58 __dispatch_kq_drain + 188 libdispatch.dylib 0x18e37d56c __dispatch_workloop_worker_thread + 2536 libdispatch.dylib 0x18e37e1e0 __dispatch_apply_with_attr_f + 612 libdispatch.dylib 0x18e388e10 __dispatch_mach_msg_not_sent + 296 libsystem_pthread.dylib 0x1d3dffdf8 _pthread_dependency_wait_np.cold.3 + 8720

    opened by jufn 1
  • [!] Error installing CocoaAsyncSocket [!] /usr/bin/git clone https://github.com/robbiehanson/CocoaAsyncSocket.git /var/folders/44/pdz2cl0561z4jh2377tl293h0000gp/T/d20221207-3976-gkz985 --template= --single-branch --depth 1 --branch 7.6.5

    [!] Error installing CocoaAsyncSocket [!] /usr/bin/git clone https://github.com/robbiehanson/CocoaAsyncSocket.git /var/folders/44/pdz2cl0561z4jh2377tl293h0000gp/T/d20221207-3976-gkz985 --template= --single-branch --depth 1 --branch 7.6.5

    I'm trying to install pods. but it has shown these errors.

    fatal: not a git repository (or any of the parent directories): .git Analyzing dependencies Fetching podspec for DoubleConversion from ../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec [Codegen] Found FBReactNativeSpec Fetching podspec for RCT-Folly from ../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec Fetching podspec for boost from ../node_modules/react-native/third-party-podspecs/boost.podspec Fetching podspec for glog from ../node_modules/react-native/third-party-podspecs/glog.podspec Fetching podspec for hermes-engine from ../node_modules/react-native/sdks/hermes/hermes-engine.podspec Downloading dependencies Installing CocoaAsyncSocket (7.6.5)

    [!] Error installing CocoaAsyncSocket [!] /usr/bin/git clone https://github.com/robbiehanson/CocoaAsyncSocket.git /var/folders/44/pdz2cl0561z4jh2377tl293h0000gp/T/d20221207-3976-gkz985 --template= --single-branch --depth 1 --branch 7.6.5

    Cloning into '/var/folders/44/pdz2cl0561z4jh2377tl293h0000gp/T/d20221207-3976-gkz985'... ssh: Could not resolve hostname github.com:robbiehanson: nodename nor servname provided, or not known fatal: Could not read from remote repository.

    Please make sure you have the correct access rights and the repository exists.

    opened by dominicg666 0
  • Error Domain=NSPOSIXErrorDomain Code=60

    Error Domain=NSPOSIXErrorDomain Code=60 "Operation timed out"

    Hi, i need to connect A with socket, if connecting success, A will send me B's ipaddress. Every time i can connect with A successful. But when i get B's ipaddress and then connect with B, the xcode console shows the error Error "Domain=NSPOSIXErrorDomain Code=60 "Operation timed out XXXXXXXX ERRor in connect() function" (my devices are ios 15.3.1 and ios 14.7.1). It was ok with my devices before, but it doesn't work every time recently. When i use colleague's ios 11, it can connect with B successful every time. I noticed it may be caused by TLS 1.3 (https://developer.apple.com/forums/thread/682247), but i am not sure.

    opened by cyjFS 0
  • Is this library supported for iOS 13+ ?

    Is this library supported for iOS 13+ ?

    Hello, guys. I'm working with third party library, depended on CocoaAsyncSocket. The target of my host project is iOS 14+ and on compile time I got a lot of warnings from GCDAsyncSocket.m, looks like

    'SSLSetIOFuncs' is deprecated: first deprecated in iOS 13.0 - No longer supported. Use Network.framework.

    1. Have we any way to solve this issues in future releases of CocoaAsyncSocket?
    2. Can you explain, have we any risc to got removeance of deprected API in release with your framework?

    I can't connect with maintainer of third-party framework, depended on CocoaAsyncSocket and has no way to solve this issues with them, so, hopes you'll give me any info about.

    PS Also, I found issues #795 #756 but their contents cannot be reassuring - we can't stop using your framework and migrate to Apple's Network.framework ¯\_(ツ)_/¯

    I will be glad for any information from you. Thanks!

    opened by iserbius 2
  • Xcode14.0 App Store Connect Operation Error

    Xcode14.0 App Store Connect Operation Error

    ”The app references non-public selectors in Payload/xxx.app/Frameworks/CocoaAsyncSocket_-2A89F950105224A4_PackageProduct.framework/CocoaAsyncSocket_-2A89F950105224A4_PackageProduct: newSocketQueueForConnectionFromAddress:onSocket:, socket:didAcceptNewSocket:, socket:didConnectToHost:port:, socket:didConnectToUrl:, socket:didReadData:withTag:, socket:didReadPartialDataOfLength:tag:, socket:didReceiveTrust:completionHandler:, socket:didWriteDataWithTag:, socket:didWritePartialDataOfLength:tag:, socket:shouldTimeoutReadWithTag:elapsed:bytesDone:, socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:, socketDidCloseReadStream:, socketDidDisconnect:withError:, socketDidSecure:“

    The application does not use any private functions. However, the CocoaAsyncSocket of the dependent SwiftPM prompts references non public selectors on Xcode14.0. The package is unusable. Please take a look

    opened by KorsChen 4
  • Fix iOS 16 crash by kCFStreamNetworkServiceTypeVoIP

    Fix iOS 16 crash by kCFStreamNetworkServiceTypeVoIP

    Fix iOS 16 crash by deprecated API, kCFStreamNetworkServiceTypeVoIP is deprecated, use PKPushTypeVoIP in PushKit. I see this PR 802, use kCFStreamNetworkServiceTypeBackground replace kCFStreamNetworkServiceTypeVoIP.

    I fix the crash by use 802 code.

    In my App, I user CocoaMQTT, and it depend CocoaAsyncSocket, my App crash when mqtt begin to connect:

    Linked against modern SDK, VOIP socket will not wake. Use Local Push Connectivity instead
    
    libsp.dylib`spd_checkin_socket.cold.1:
    
      0x221e28364 <+0>: adrp  x8, 141901
    
      0x221e28368 <+4>: adrp  x9, 0
    
      0x221e2836c <+8>: add  x9, x9, #0xa3f      ; "Linked against modern SDK, VOIP socket will not wake. Use Local Push Connectivity instead"
    
      0x221e28370 <+12>: str  x9, [x8, #0x400]
    
    -> 0x221e28374 <+16>: brk  #0x1
    

    So I read Foundation code what‘s wrong with kCFStreamNetworkServiceTypeVoIP

    /* deprecated network service type: */
    
    CFN_EXPORT const CFStringRef kCFStreamNetworkServiceTypeVoIP       CF_DEPRECATED(10_7, 10_11, 4_0, 9_0, "use PushKit for VoIP control purposes");   // voice over IP control - this service type is deprecated in favor of using PushKit for VoIP control
    

    kCFStreamNetworkServiceTypeVoIP is deprecated, and issues 402 mention.

    Add #import to GCDAsyncSocket.m #import <PushKit/PushKit.h>

    Replace in enableBackgroundingOnSocketWithCaveat r1 = CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType, PKPushTypeVoIP); r2 = CFWriteStreamSetProperty(writeStream, kCFStreamNetworkServiceType, PKPushTypeVoIP);

    Then I use PKPushTypeVoIP replace kCFStreamNetworkServiceTypeVoIP.

    Great, it’s OK now.

    opened by seasonZhu 1
Releases(7.6.5)
  • 7.6.5(Dec 13, 2020)

    • Updating minimum deployment version to iOS 9 #741
    • Fix for sending UDP multicast on IPv6 #746
    • Fix -Watimport-in-framework-header #723
    • Add ALPN support #711
    • Replace UIWebView with WKWebView #712
    Source code(tar.gz)
    Source code(zip)
  • 7.6.4(Feb 18, 2020)

    • Swift Package Manager support #706
    • Fix Xcode 11 warnings & migrate to Test Plans #708
    • Use the NS_ERROR_ENUM macro #663
    • Capture errno before dispatching to another thread #648
    • Fix potentially leaking file descriptor #677
    • Minor features (NSNetService and nullability fixes) #674
    • Misc fixes #673
    • Correctly handle different size of SSLCipherSuite on macOS vs iOS #682

    Compare https://github.com/robbiehanson/CocoaAsyncSocket/compare/7.6.3...7.6.4

    Source code(tar.gz)
    Source code(zip)
    CocoaAsyncSocket.framework.zip(5.60 MB)
  • 7.6.3(Mar 30, 2018)

    • Fix hundreds of CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warnings #610 (thanks @zhouzhongguang)
    • Fix issue where readSource may not be resumed #599 (thanks @jdeff)
    • Improve the reliability of tests when run repeatedly. #601 (thanks @jdeff)
    • Fix a few other minor warnings
    • Unify all test targets
    • Add shared test script Tests/test-all.sh to run all tests locally as well as on Travis

    Compare https://github.com/robbiehanson/CocoaAsyncSocket/compare/7.6.2...7.6.3

    Source code(tar.gz)
    Source code(zip)
    CocoaAsyncSocket.framework.zip(5.67 MB)
  • 7.6.1(May 11, 2017)

    • Fix KERN_INVALID_ADDRESS crash in [currentRunLoop runMode] #541 #545
    • Enlarge max UDP packet size #222 #535 #536
    • Create GCDAsyncSocket from already connected BSD socket #548 #550

    Thank you @mrvincenzo @esilverberg @Noskthing!

    Source code(tar.gz)
    Source code(zip)
  • 7.6.0(Feb 22, 2017)

    • Removes legacy RunLoop code
    • Tests use Swift 3
    • Fix IPv6 UDP bug: https://github.com/robbiehanson/CocoaAsyncSocket/pull/512
    • Fix file descriptor leak: https://github.com/robbiehanson/CocoaAsyncSocket/pull/523
    Source code(tar.gz)
    Source code(zip)
  • 7.5.1(Nov 9, 2016)

    • Fix some issues with nullability and generics annotations #463 #453
    • Fix potential issue with preferIPv6 #451
    • Fix minor typo in documentation #483

    Thanks @boraseoksoon @svdo @hzfanfei!

    Source code(tar.gz)
    Source code(zip)
  • 7.5.0(Jul 7, 2016)

    • Add nullability annotations, generics, and modern Obj-C syntax for better Swift compatibility
    • Add deprecation warnings for RunLoop versions and remove them from default podspec. They are still available by using the CocoaAsyncSocket/RunLoop subspec but may be removed in a future release.
    • Better IPv6 support: PR #430 Partial implementation of Happy Eyeballs which will connect to both IPv4 and IPv6 addresses. Preferred protocol is used first and then other protocol, if available, will be tried after a delay (default 300ms). An additional fix to address an Apple bug regarding IPv6 port numbers was merged.

    Thanks! @polmum @awmwong @jpickering @Smeegol

    Source code(tar.gz)
    Source code(zip)
  • 7.4.3(Feb 18, 2016)

    • Merge PRs #367 #398 #290
    • Fix an issue where the podspec's inclusion of CocoaAsyncSocket.h conflicts with the automatically generated umbrella header
    • New subspecs for including only GCD or RunLoop versions
    • Add a very basic Swift test example
    • Reorganize tests
    Source code(tar.gz)
    Source code(zip)
  • 7.4.2(Aug 12, 2015)

    • Merge PRs: #222, #255, #254, #291, #284
    • Carthage Support
    • Travis-CI Support
    • Initial XCTest Support

    Thanks @erichocean @epatey @adly-holler!

    Source code(tar.gz)
    Source code(zip)
  • 7.3.4(Jan 26, 2014)

    Bugfixes

    GCDAsyncUdpSocket
    • Issue #211. Fixed wrong condition for all methods that can be used in performBlock:.
    • Fixed multicast operations for IPv6 (problem with performMulticastRequest:forGroup:onInterface:error: method for IPv6).
    Source code(tar.gz)
    Source code(zip)
  • 7.3.3(Dec 27, 2013)

    Bugfixes

    AsyncUdpSocket
    • Issue #21. Prevent SIGPIPE signal for suspended iOS apps.
    GCDAsyncSocket
    • Issues #105 and #198. Fixed warnings (float-to-int conversions and comparison between signed and unsigned values).

    • Issue #150. Fixed typo in log message - there was wrong parameter.

    • Issue #154. Typo - unary operator was used instead of binary.

    • Fixed bug - socket was closed with nil error if SecureTransport is unavaliable.

    • Fixed bug that prevent the socket from reading any data with no SSL:

      #define IS_SECURE_TRANSPORT_AVAILABLE NO
      #define SECURE_TRANSPORT_MAYBE_AVAILABLE 0
      #define SECURE_TRANSPORT_MAYBE_UNAVAILABLE 1
      
    GCDAsyncUdpSocket
    • Issue #141. Fixed typo that prevented ipv6 udp sockets from updating after binding, leaving host, port etc empty.

    Other

    • CocoaLumberjack updated to version 1.7.0 (some crash while logging are fixed)
    Source code(tar.gz)
    Source code(zip)
Owner
Robbie Hanson
Robbie Hanson
Lightweight Networking and Parsing framework made for iOS, Mac, WatchOS and tvOS.

NetworkKit A lightweight iOS, Mac and Watch OS framework that makes networking and parsing super simple. Uses the open-sourced JSONHelper with functio

Alex Telek 30 Nov 19, 2022
Socket.io iOS and OSX Client compatible with v1.0 and later

SocketIO-Kit ⚠️ This project is no longer maintained. Please use the official framework Socket.IO-Client-Swift. SocketIO-Kit is a Socket.io iOS client

Ricardo Pereira 140 Mar 9, 2022
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.

BlueSocket Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. Prerequisites Swift Swift Open Source swift-5.1

Kitura 1.3k Dec 26, 2022
🔌 Non-blocking TCP socket layer, with event-driven server and client.

Original authors Honza Dvorsky - http://honzadvorsky.com, @czechboy0 Matthias Kreileder - @matthiaskr1 At the request of the original authors, we ask

Vapor Community 574 Dec 7, 2022
DispatchSource based socket framework written in pure Swift

SwiftDSSocket Overview SwiftDSSocket is a purely swift based asynchronous socket framework built atop DispatchSource. Function signatures are pretty m

Yi Huang 65 Nov 15, 2022
MVVM project to show AQI of cities via web socket

Air Quality Monitoring Application Swift project with JSON parsing using codable About the application The app consists of live realtime data from the

Pran Kishore 0 Nov 27, 2021
This app is using web-socket for realtime updation of aqi for dedicated inidan cities.

CityWiseAQI This app is using web-socket for realtime updation of aqi for dedicated inidan cities. We're following MVVM architecture in this app. This

Vipul Kumar 2 Feb 7, 2022
Swift async/await based socket

Socket Swift async/await based socket library Introduction This library exposes an idiomatic Swift API for interacting with POSIX sockets via an async

null 89 Dec 29, 2022
QwikHttp is a robust, yet lightweight and simple to use HTTP networking library for iOS, tvOS and watchOS

QwikHttp is a robust, yet lightweight and simple to use HTTP networking library. It allows you to customize every aspect of your http requests within a single line of code, using a Builder style syntax to keep your code super clean.

Logan Sease 2 Mar 20, 2022
A networking library for iOS, macOS, watchOS and tvOS

Thunder Request Thunder Request is a Framework used to simplify making http and https web requests. Installation Setting up your app to use ThunderBas

3 SIDED CUBE 16 Nov 19, 2022
A modern download manager based on NSURLSession to deal with asynchronous downloading, management and persistence of multiple files.

TWRDownloadManager TWRDownloadManager A modern download manager for iOS (Objective C) based on NSURLSession to deal with asynchronous downloading, man

Michelangelo Chasseur 407 Nov 19, 2022
Swish is a networking library that is particularly meant for requesting and decoding JSON via Decodable

Swish Nothing but net(working). Swish is a networking library that is particularly meant for requesting and decoding JSON via Decodable. It is protoco

thoughtbot, inc. 369 Nov 14, 2022
foursquare iOS networking library

FSNetworking foursquare's iOS networking library FSN is a small library for HTTP networking on iOS. It comprises a single class, FSNConnection, and se

Foursquare 386 Sep 1, 2022
🏇 A Swift HTTP / HTTPS networking library just incidentally execute on machines

Thus, programs must be written for people to read, and only incidentally for machines to execute. Harold Abelson, "Structure and Interpretation of Com

John Lui 845 Oct 30, 2022
Malibu is a networking library built on promises

Description Palm trees, coral reefs and breaking waves. Welcome to the surf club Malibu, a networking library built on promises. It's more than just a

Vadym Markov 410 Dec 30, 2022
RSNetworking is a networking library written entirly for the Swift programming language.

RSNetworking is a networking library written entirly for the Swift programming language.

null 18 Feb 25, 2018
ServiceData is an HTTP networking library written in Swift which can download different types of data.

ServiceData Package Description : ServiceData is an HTTP networking library written in Swift which can download different types of data. Features List

Mubarak Alseif 0 Nov 11, 2021
Malibu is a networking library built on promises

Description Palm trees, coral reefs and breaking waves. Welcome to the surf club Malibu, a networking library built on promises. It's more than just a

HyperRedink 10 Jan 29, 2022
A networking library for Swift

Nikka Nikka is a super simple Swift HTTP networking library that comes with many extensions to make it modular and really powerful. Installation Usage

Emilien Stremsdoerfer 29 Nov 4, 2022