Skip to content

Commit

Permalink
Merge pull request #673 from seanm/MiscFixes
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
chrisballinger authored Feb 17, 2020
2 parents f63edc6 + 8fd1b11 commit 399cd4d
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 159 deletions.
17 changes: 7 additions & 10 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
[![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)


CocoaAsyncSocket provides easy-to-use and powerful asynchronous socket libraries for Mac and iOS. The classes are described below.
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](http://cocoapods.org) by adding this line to your Podfile:
Install using [CocoaPods](https://cocoapods.org) by adding this line to your Podfile:

````ruby
use_frameworks! # Add this if you are targeting iOS 8+ or using Swift
Expand Down Expand Up @@ -49,10 +49,10 @@ You can also include it into your project by adding the source files directly, b
Using Objective-C:

```obj-c
// When using iOS 8+ frameworks
// When using Clang Modules:
@import CocoaAsyncSocket;

// OR when not using frameworks, targeting iOS 7 or below
// or when not:
#import "GCDAsyncSocket.h" // for TCP
#import "GCDAsyncUdpSocket.h" // for UDP
```
Expand All @@ -67,7 +67,7 @@ import CocoaAsyncSocket

**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.<br/>
- Native Objective-C, fully self-contained in one class.<br/>
_No need to muck around with sockets or streams. This class handles everything for you._

- Full delegate support<br/>
Expand All @@ -88,14 +88,11 @@ import CocoaAsyncSocket
- Fully GCD based and Thread-Safe<br/>
_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._

- The Latest Technology & Performance Optimizations<br/>
_Internally the library takes advantage of technologies such as [kqueue's](http://en.wikipedia.org/wiki/Kqueue) to limit [system calls](http://en.wikipedia.org/wiki/System_call) and optimize buffer allocations. In other words, peak performance._

## 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.<br/>
- Native Objective-C, fully self-contained in one class.<br/>
_No need to muck around with low-level sockets. This class handles everything for you._

- Full delegate support.<br/>
Expand All @@ -114,7 +111,7 @@ import CocoaAsyncSocket

For those new(ish) to networking, it's recommended you **[read the wiki](https://github.com/robbiehanson/CocoaAsyncSocket/wiki)**.<br/>_Sockets might not work exactly like you think they do..._

**Still got questions?** Try the **[CocoaAsyncSocket Mailing List](http://groups.google.com/group/cocoaasyncsocket)**.
**Still got questions?** Try the **[CocoaAsyncSocket Mailing List](https://groups.google.com/group/cocoaasyncsocket)**.
***

Love the project? Wanna buy me a ☕️&nbsp;&nbsp;? (or a 🍺&nbsp;&nbsp;😀&nbsp;):
Expand Down
6 changes: 3 additions & 3 deletions Source/GCD/Documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h1>Welcome to the CocoaAsyncSocket project!</h1>

<p>
A wealth of documentation can be found on the Google Code homepage:</br>
A wealth of documentation can be found on the GitHub homepage:</br>
<a href="https://github.com/robbiehanson/CocoaAsyncSocket">https://github.com/robbiehanson/CocoaAsyncSocket</a>
</p>

Expand All @@ -30,12 +30,12 @@ <h4>
</p>

<p>
Did I mention you should read the headers? They're docemented very nicely, in plain english.
Did I mention you should read the headers? They're documented very nicely, in plain English.
</p>

<p>
If you have any questions you are welcome to post to the CocoaAsyncSocket mailing list:<br/>
<a href="http://groups.google.com/group/cocoaasyncsocket">http://groups.google.com/group/cocoaasyncsocket</a><br/>
<a href="https://groups.google.com/group/cocoaasyncsocket">http://groups.google.com/group/cocoaasyncsocket</a><br/>
<br/>
The list is archived, and available for browsing online.<br/>
You may be able to instantly find the answer you're looking for with a quick search.<br/>
Expand Down
18 changes: 9 additions & 9 deletions Source/GCD/GCDAsyncSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
- (instancetype)init;
- (instancetype)initWithSocketQueue:(nullable dispatch_queue_t)sq;
- (instancetype)initWithDelegate:(nullable id<GCDAsyncSocketDelegate>)aDelegate delegateQueue:(nullable dispatch_queue_t)dq;
- (instancetype)initWithDelegate:(nullable id<GCDAsyncSocketDelegate>)aDelegate delegateQueue:(nullable dispatch_queue_t)dq socketQueue:(nullable dispatch_queue_t)sq;
- (instancetype)initWithDelegate:(nullable id<GCDAsyncSocketDelegate>)aDelegate delegateQueue:(nullable dispatch_queue_t)dq socketQueue:(nullable dispatch_queue_t)sq NS_DESIGNATED_INITIALIZER;

/**
* Create GCDAsyncSocket from already connect BSD socket file descriptor
Expand Down Expand Up @@ -254,7 +254,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
* struct sockaddr sa -> NSData *dsa = [NSData dataWithBytes:&remoteAddr length:remoteAddr.sa_len];
* struct sockaddr *sa -> NSData *dsa = [NSData dataWithBytes:remoteAddr length:remoteAddr->sa_len];
*
* This method invokes connectToAdd
* This method invokes connectToAddress:remoteAddr viaInterface:nil withTimeout:-1 error:errPtr.
**/
- (BOOL)connectToAddress:(NSData *)remoteAddr error:(NSError **)errPtr;

Expand Down Expand Up @@ -435,7 +435,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
* The given buffer will automatically be increased in size if needed.
*
* If the timeout value is negative, the read operation will not use a timeout.
* If the buffer if nil, the socket will create a buffer for you.
* If the buffer is nil, the socket will create a buffer for you.
*
* If the bufferOffset is greater than the length of the given buffer,
* the method will do nothing, and the delegate will not be called.
Expand All @@ -457,7 +457,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
* A maximum of length bytes will be read.
*
* If the timeout value is negative, the read operation will not use a timeout.
* If the buffer if nil, a buffer will automatically be created for you.
* If the buffer is nil, a buffer will automatically be created for you.
* If maxLength is zero, no length restriction is enforced.
*
* If the bufferOffset is greater than the length of the given buffer,
Expand Down Expand Up @@ -489,7 +489,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
* The given buffer will automatically be increased in size if needed.
*
* If the timeout value is negative, the read operation will not use a timeout.
* If the buffer if nil, a buffer will automatically be created for you.
* If the buffer is nil, a buffer will automatically be created for you.
*
* If the length is 0, this method does nothing and the delegate is not called.
* If the bufferOffset is greater than the length of the given buffer,
Expand Down Expand Up @@ -535,7 +535,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
* The given buffer will automatically be increased in size if needed.
*
* If the timeout value is negative, the read operation will not use a timeout.
* If the buffer if nil, a buffer will automatically be created for you.
* If the buffer is nil, a buffer will automatically be created for you.
*
* If the bufferOffset is greater than the length of the given buffer,
* the method will do nothing (except maybe print a warning), and the delegate will not be called.
Expand Down Expand Up @@ -600,7 +600,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
* The given buffer will automatically be increased in size if needed.
*
* If the timeout value is negative, the read operation will not use a timeout.
* If the buffer if nil, a buffer will automatically be created for you.
* If the buffer is nil, a buffer will automatically be created for you.
*
* If maxLength is zero, no length restriction is enforced.
* Otherwise if maxLength bytes are read without completing the read,
Expand Down Expand Up @@ -1116,7 +1116,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {
/**
* Called when a socket has read in data, but has not yet completed the read.
* This would occur if using readToData: or readToLength: methods.
* It may be used to for things such as updating progress bars.
* It may be used for things such as updating progress bars.
**/
- (void)socket:(GCDAsyncSocket *)sock didReadPartialDataOfLength:(NSUInteger)partialLength tag:(long)tag;

Expand All @@ -1127,7 +1127,7 @@ typedef NS_ERROR_ENUM(GCDAsyncSocketErrorDomain, GCDAsyncSocketError) {

/**
* Called when a socket has written some data, but has not yet completed the entire write.
* It may be used to for things such as updating progress bars.
* It may be used for things such as updating progress bars.
**/
- (void)socket:(GCDAsyncSocket *)sock didWritePartialDataOfLength:(NSUInteger)partialLength tag:(long)tag;

Expand Down
Loading

0 comments on commit 399cd4d

Please sign in to comment.