|
| 1 | +CocoaAsyncSocket provides easy-to-use and powerful asynchronous socket libraries for Mac and iOS. The classes are described below. |
| 2 | + |
| 3 | +## TCP |
| 4 | + |
| 5 | +**GCDAsyncSocket** and **AsyncSocket** are TCP/IP socket networking libraries. Here are the key features available in both: |
| 6 | + |
| 7 | +- Native objective-c, fully self-contained in one class.<br/> |
| 8 | + _No need to muck around with sockets or streams. This class handles everything for you._ |
| 9 | + |
| 10 | +- Full delegate support<br/> |
| 11 | + _Errors, connections, read completions, write completions, progress, and disconnections all result in a call to your delegate method._ |
| 12 | + |
| 13 | +- Queued non-blocking reads and writes, with optional timeouts.<br/> |
| 14 | + _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._ |
| 15 | + |
| 16 | +- Automatic socket acceptance.<br/> |
| 17 | + _Spin up a server socket, tell it to accept connections, and it will call you with new instances of itself for each connection._ |
| 18 | + |
| 19 | +- Support for TCP streams over IPv4 and IPv6.<br/> |
| 20 | + _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._ |
| 21 | + |
| 22 | +- Support for TLS / SSL<br/> |
| 23 | + _Secure your socket with ease using just a single method call. Available for both client and server sockets._ |
| 24 | + |
| 25 | +**GCDAsyncSocket** is built atop Grand Central Dispatch: |
| 26 | + |
| 27 | +- Fully GCD based and Thread-Safe<br/> |
| 28 | + _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._ |
| 29 | + |
| 30 | +- The Latest Technology & Performance Optimizations<br/> |
| 31 | + _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._ |
| 32 | + |
| 33 | +**AsyncSocket** wraps CFSocket and CFStream: |
| 34 | + |
| 35 | +- Fully Run-loop based<br/> |
| 36 | + _Use it on the main thread or a worker thread. It plugs into the NSRunLoop with configurable modes._ |
| 37 | + |
| 38 | +## UDP |
| 39 | + |
| 40 | +**GCDAsyncUdpSocket** and **AsyncUdpSocket** are UDP/IP socket networking libraries. Here are the key features available in both: |
| 41 | + |
| 42 | +- Native objective-c, fully self-contained in one class.<br/> |
| 43 | + _No need to muck around with low-level sockets. This class handles everything for you._ |
| 44 | + |
| 45 | +- Full delegate support.<br/> |
| 46 | + _Errors, send completions, receive completions, and disconnections all result in a call to your delegate method._ |
| 47 | + |
| 48 | +- Queued non-blocking send and receive operations, with optional timeouts.<br/> |
| 49 | + _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._ |
| 50 | + |
| 51 | +- Support for IPv4 and IPv6.<br/> |
| 52 | + _Automatically send/recv using IPv4 and/or IPv6. No more worrying about multiple sockets._ |
| 53 | + |
| 54 | +**GCDAsyncUdpSocket** is built atop Grand Central Dispatch: |
| 55 | + |
| 56 | +- Fully GCD based and Thread-Safe<br/> |
| 57 | + _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._ |
| 58 | + |
| 59 | +**AsyncUdpSocket** wraps CFSocket: |
| 60 | + |
| 61 | +- Fully Run-loop based<br/> |
| 62 | + _Use it on the main thread or a worker thread. It plugs into the NSRunLoop with configurable modes._ |
0 commit comments