2016-07-07 5 views

答えて

5

希望これはあなたを助けるかもしれない:

あなただけのiOSにしている場合であっても、おそらく近い将来にマルチコアのiOSデバイスが存在します。そして、GCDはGCDAsyncSocketで追加のリソースを活用するための優れた方法となります

GCDAsyncSocket

  • GCDAsyncSocketの最小要件:MacのOS X 10.6以降またはiOS 4.0以降

  • GCDAsyncSocketはAsyncSocketよりも優れたパフォーマンスを発揮します。

  • 他のスレッドに暗号化/復号化(SSL/TLSではない)をオフロードすることを考えてみると、GCDのやり方が良い選択肢になると思います。

GCDAsyncSocketの特定の機能が含まれます:

1. Classic delegate-style support. 
    2. It allows allows for parallel socket IO and data processing, as well as easy thread-safety. 
    3. Queued non-blocking reads and writes, with optional timeouts. 
    4. Automatic support for IPv4 and IPv6. 
    5. SSL/TLS support. 
    6. Built upon the latest technologies such as queues and GCD. 
    7. Self-contained in one class. 
    You don't need to muck around with streams or sockets. The class handles all of that. 

AsyncSocket

をAsyncSocketライブラリもAsyncSocket呼ばれる一つのクラスで構成されています。 AsyncSocketのインスタンスは、1つのソケットを表します。ソケットは、待機ソケットまたは接続ソケットです。あなたが前のMac OS X 10.6以降またはiOS 4.0以降にサポートOSのバージョンに必要がある場合

  • することは、あなたは今のAsyncSocketに固執する必要があります。

  • AsyncSocketは簡単に統合された「Fire and forget」ネットワークを提供し、アプリケーションがネットワークを容易にサポートできるようにします。

機能は次のとおりです。

• Queued non-blocking reads and writes, with timeouts. 
• Automatic socket acceptance. 
• Delegate support. 
• Run-loop based, not thread based. 
• Self-contained in one class. You do not need to muck around with a collection of stream or socket instances. The class handles all of that. 
• Support for TCP streams. AsyncSocket does not support UDP or multicast sockets. 
• Based on Apple’s own CFSocket and CFStream Carbon APIs. 

を参考Reference_GCDAsyncSocket

リファレンスAbout AsyncSocket

+0

非常に感謝~~~ – Kira

関連する問題