PageRenderTime 62ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/Pods/Documentation/CocoaAsyncSocket/docset/Contents/Resources/Documents/Classes/GCDAsyncSocket.html

https://gitlab.com/mba811/tokaidoapp
HTML | 3662 lines | 1919 code | 1743 blank | 0 comment | 0 complexity | 06b7c318a53495aab9a3ebf3c0b6bc20 MD5 | raw file
Possible License(s): BSD-3-Clause

Large files files are truncated, but you can click here to view the full file

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
  5. <title>GCDAsyncSocket Class Reference</title>
  6. <meta id="xcode-display" name="xcode-display" content="render"/>
  7. <link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
  8. <link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
  9. <meta name="generator" content="appledoc 2.1 (build 858)" />
  10. </head>
  11. <body>
  12. <header id="top_header">
  13. <div id="library" class="hideInXcode">
  14. <h1><a id="libraryTitle" href="../index.html">CocoaAsyncSocket 0.0.1 </a></h1>
  15. <a id="developerHome" href="../index.html">Dustin Voss and Robbie Hanson</a>
  16. </div>
  17. <div id="title" role="banner">
  18. <h1 class="hideInXcode">GCDAsyncSocket Class Reference</h1>
  19. </div>
  20. <ul id="headerButtons" role="toolbar">
  21. <li id="toc_button">
  22. <button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
  23. </li>
  24. <li id="jumpto_button" role="navigation">
  25. <select id="jumpTo">
  26. <option value="top">Jump To&#133;</option>
  27. <option value="tasks">Tasks</option>
  28. <option value="class_methods">Class Methods</option>
  29. <option value="//api/name/CRData">&nbsp;&nbsp;&nbsp;&nbsp;+ CRData</option>
  30. <option value="//api/name/CRLFData">&nbsp;&nbsp;&nbsp;&nbsp;+ CRLFData</option>
  31. <option value="//api/name/LFData">&nbsp;&nbsp;&nbsp;&nbsp;+ LFData</option>
  32. <option value="//api/name/ZeroData">&nbsp;&nbsp;&nbsp;&nbsp;+ ZeroData</option>
  33. <option value="//api/name/getHost:port:fromAddress:">&nbsp;&nbsp;&nbsp;&nbsp;+ getHost:port:fromAddress:</option>
  34. <option value="//api/name/hostFromAddress:">&nbsp;&nbsp;&nbsp;&nbsp;+ hostFromAddress:</option>
  35. <option value="//api/name/portFromAddress:">&nbsp;&nbsp;&nbsp;&nbsp;+ portFromAddress:</option>
  36. <option value="instance_methods">Instance Methods</option>
  37. <option value="//api/name/acceptOnInterface:port:error:">&nbsp;&nbsp;&nbsp;&nbsp;- acceptOnInterface:port:error:</option>
  38. <option value="//api/name/acceptOnPort:error:">&nbsp;&nbsp;&nbsp;&nbsp;- acceptOnPort:error:</option>
  39. <option value="//api/name/autoDisconnectOnClosedReadStream">&nbsp;&nbsp;&nbsp;&nbsp;- autoDisconnectOnClosedReadStream</option>
  40. <option value="//api/name/connectToAddress:error:">&nbsp;&nbsp;&nbsp;&nbsp;- connectToAddress:error:</option>
  41. <option value="//api/name/connectToAddress:viaInterface:withTimeout:error:">&nbsp;&nbsp;&nbsp;&nbsp;- connectToAddress:viaInterface:withTimeout:error:</option>
  42. <option value="//api/name/connectToAddress:withTimeout:error:">&nbsp;&nbsp;&nbsp;&nbsp;- connectToAddress:withTimeout:error:</option>
  43. <option value="//api/name/connectToHost:onPort:error:">&nbsp;&nbsp;&nbsp;&nbsp;- connectToHost:onPort:error:</option>
  44. <option value="//api/name/connectToHost:onPort:viaInterface:withTimeout:error:">&nbsp;&nbsp;&nbsp;&nbsp;- connectToHost:onPort:viaInterface:withTimeout:error:</option>
  45. <option value="//api/name/connectToHost:onPort:withTimeout:error:">&nbsp;&nbsp;&nbsp;&nbsp;- connectToHost:onPort:withTimeout:error:</option>
  46. <option value="//api/name/connectedAddress">&nbsp;&nbsp;&nbsp;&nbsp;- connectedAddress</option>
  47. <option value="//api/name/connectedHost">&nbsp;&nbsp;&nbsp;&nbsp;- connectedHost</option>
  48. <option value="//api/name/connectedPort">&nbsp;&nbsp;&nbsp;&nbsp;- connectedPort</option>
  49. <option value="//api/name/delegate">&nbsp;&nbsp;&nbsp;&nbsp;- delegate</option>
  50. <option value="//api/name/delegateQueue">&nbsp;&nbsp;&nbsp;&nbsp;- delegateQueue</option>
  51. <option value="//api/name/disconnect">&nbsp;&nbsp;&nbsp;&nbsp;- disconnect</option>
  52. <option value="//api/name/disconnectAfterReading">&nbsp;&nbsp;&nbsp;&nbsp;- disconnectAfterReading</option>
  53. <option value="//api/name/disconnectAfterReadingAndWriting">&nbsp;&nbsp;&nbsp;&nbsp;- disconnectAfterReadingAndWriting</option>
  54. <option value="//api/name/disconnectAfterWriting">&nbsp;&nbsp;&nbsp;&nbsp;- disconnectAfterWriting</option>
  55. <option value="//api/name/enableBackgroundingOnSocket">&nbsp;&nbsp;&nbsp;&nbsp;- enableBackgroundingOnSocket</option>
  56. <option value="//api/name/getDelegate:delegateQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- getDelegate:delegateQueue:</option>
  57. <option value="//api/name/init">&nbsp;&nbsp;&nbsp;&nbsp;- init</option>
  58. <option value="//api/name/initWithDelegate:delegateQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithDelegate:delegateQueue:</option>
  59. <option value="//api/name/initWithDelegate:delegateQueue:socketQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithDelegate:delegateQueue:socketQueue:</option>
  60. <option value="//api/name/initWithSocketQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithSocketQueue:</option>
  61. <option value="//api/name/isConnected">&nbsp;&nbsp;&nbsp;&nbsp;- isConnected</option>
  62. <option value="//api/name/isDisconnected">&nbsp;&nbsp;&nbsp;&nbsp;- isDisconnected</option>
  63. <option value="//api/name/isIPv4">&nbsp;&nbsp;&nbsp;&nbsp;- isIPv4</option>
  64. <option value="//api/name/isIPv4Enabled">&nbsp;&nbsp;&nbsp;&nbsp;- isIPv4Enabled</option>
  65. <option value="//api/name/isIPv4PreferredOverIPv6">&nbsp;&nbsp;&nbsp;&nbsp;- isIPv4PreferredOverIPv6</option>
  66. <option value="//api/name/isIPv6">&nbsp;&nbsp;&nbsp;&nbsp;- isIPv6</option>
  67. <option value="//api/name/isIPv6Enabled">&nbsp;&nbsp;&nbsp;&nbsp;- isIPv6Enabled</option>
  68. <option value="//api/name/isSecure">&nbsp;&nbsp;&nbsp;&nbsp;- isSecure</option>
  69. <option value="//api/name/localAddress">&nbsp;&nbsp;&nbsp;&nbsp;- localAddress</option>
  70. <option value="//api/name/localHost">&nbsp;&nbsp;&nbsp;&nbsp;- localHost</option>
  71. <option value="//api/name/localPort">&nbsp;&nbsp;&nbsp;&nbsp;- localPort</option>
  72. <option value="//api/name/performBlock:">&nbsp;&nbsp;&nbsp;&nbsp;- performBlock:</option>
  73. <option value="//api/name/progressOfReadReturningTag:bytesDone:total:">&nbsp;&nbsp;&nbsp;&nbsp;- progressOfReadReturningTag:bytesDone:total:</option>
  74. <option value="//api/name/progressOfWriteReturningTag:bytesDone:total:">&nbsp;&nbsp;&nbsp;&nbsp;- progressOfWriteReturningTag:bytesDone:total:</option>
  75. <option value="//api/name/readDataToData:withTimeout:buffer:bufferOffset:maxLength:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataToData:withTimeout:buffer:bufferOffset:maxLength:tag:</option>
  76. <option value="//api/name/readDataToData:withTimeout:buffer:bufferOffset:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataToData:withTimeout:buffer:bufferOffset:tag:</option>
  77. <option value="//api/name/readDataToData:withTimeout:maxLength:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataToData:withTimeout:maxLength:tag:</option>
  78. <option value="//api/name/readDataToData:withTimeout:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataToData:withTimeout:tag:</option>
  79. <option value="//api/name/readDataToLength:withTimeout:buffer:bufferOffset:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataToLength:withTimeout:buffer:bufferOffset:tag:</option>
  80. <option value="//api/name/readDataToLength:withTimeout:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataToLength:withTimeout:tag:</option>
  81. <option value="//api/name/readDataWithTimeout:buffer:bufferOffset:maxLength:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataWithTimeout:buffer:bufferOffset:maxLength:tag:</option>
  82. <option value="//api/name/readDataWithTimeout:buffer:bufferOffset:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataWithTimeout:buffer:bufferOffset:tag:</option>
  83. <option value="//api/name/readDataWithTimeout:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- readDataWithTimeout:tag:</option>
  84. <option value="//api/name/readStream">&nbsp;&nbsp;&nbsp;&nbsp;- readStream</option>
  85. <option value="//api/name/setAutoDisconnectOnClosedReadStream:">&nbsp;&nbsp;&nbsp;&nbsp;- setAutoDisconnectOnClosedReadStream:</option>
  86. <option value="//api/name/setDelegate:">&nbsp;&nbsp;&nbsp;&nbsp;- setDelegate:</option>
  87. <option value="//api/name/setDelegate:delegateQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- setDelegate:delegateQueue:</option>
  88. <option value="//api/name/setDelegateQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- setDelegateQueue:</option>
  89. <option value="//api/name/setIPv4Enabled:">&nbsp;&nbsp;&nbsp;&nbsp;- setIPv4Enabled:</option>
  90. <option value="//api/name/setIPv6Enabled:">&nbsp;&nbsp;&nbsp;&nbsp;- setIPv6Enabled:</option>
  91. <option value="//api/name/setPreferIPv4OverIPv6:">&nbsp;&nbsp;&nbsp;&nbsp;- setPreferIPv4OverIPv6:</option>
  92. <option value="//api/name/setUserData:">&nbsp;&nbsp;&nbsp;&nbsp;- setUserData:</option>
  93. <option value="//api/name/socket4FD">&nbsp;&nbsp;&nbsp;&nbsp;- socket4FD</option>
  94. <option value="//api/name/socket6FD">&nbsp;&nbsp;&nbsp;&nbsp;- socket6FD</option>
  95. <option value="//api/name/socketFD">&nbsp;&nbsp;&nbsp;&nbsp;- socketFD</option>
  96. <option value="//api/name/sslContext">&nbsp;&nbsp;&nbsp;&nbsp;- sslContext</option>
  97. <option value="//api/name/startTLS:">&nbsp;&nbsp;&nbsp;&nbsp;- startTLS:</option>
  98. <option value="//api/name/synchronouslySetDelegate:">&nbsp;&nbsp;&nbsp;&nbsp;- synchronouslySetDelegate:</option>
  99. <option value="//api/name/synchronouslySetDelegate:delegateQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- synchronouslySetDelegate:delegateQueue:</option>
  100. <option value="//api/name/synchronouslySetDelegateQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- synchronouslySetDelegateQueue:</option>
  101. <option value="//api/name/userData">&nbsp;&nbsp;&nbsp;&nbsp;- userData</option>
  102. <option value="//api/name/writeData:withTimeout:tag:">&nbsp;&nbsp;&nbsp;&nbsp;- writeData:withTimeout:tag:</option>
  103. <option value="//api/name/writeStream">&nbsp;&nbsp;&nbsp;&nbsp;- writeStream</option>
  104. </select>
  105. </li>
  106. </ul>
  107. </header>
  108. <nav id="tocContainer" class="isShowingTOC">
  109. <ul id="toc" role="tree">
  110. <li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
  111. </ul></li>
  112. <li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul>
  113. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/CRData">CRData</a></span></li>
  114. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/CRLFData">CRLFData</a></span></li>
  115. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/LFData">LFData</a></span></li>
  116. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/ZeroData">ZeroData</a></span></li>
  117. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/getHost:port:fromAddress:">getHost:port:fromAddress:</a></span></li>
  118. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/hostFromAddress:">hostFromAddress:</a></span></li>
  119. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/portFromAddress:">portFromAddress:</a></span></li>
  120. </ul></li>
  121. <li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
  122. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/acceptOnInterface:port:error:">acceptOnInterface:port:error:</a></span></li>
  123. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/acceptOnPort:error:">acceptOnPort:error:</a></span></li>
  124. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/autoDisconnectOnClosedReadStream">autoDisconnectOnClosedReadStream</a></span></li>
  125. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectToAddress:error:">connectToAddress:error:</a></span></li>
  126. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectToAddress:viaInterface:withTimeout:error:">connectToAddress:viaInterface:withTimeout:error:</a></span></li>
  127. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectToAddress:withTimeout:error:">connectToAddress:withTimeout:error:</a></span></li>
  128. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectToHost:onPort:error:">connectToHost:onPort:error:</a></span></li>
  129. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectToHost:onPort:viaInterface:withTimeout:error:">connectToHost:onPort:viaInterface:withTimeout:error:</a></span></li>
  130. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectToHost:onPort:withTimeout:error:">connectToHost:onPort:withTimeout:error:</a></span></li>
  131. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectedAddress">connectedAddress</a></span></li>
  132. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectedHost">connectedHost</a></span></li>
  133. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectedPort">connectedPort</a></span></li>
  134. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/delegate">delegate</a></span></li>
  135. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/delegateQueue">delegateQueue</a></span></li>
  136. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/disconnect">disconnect</a></span></li>
  137. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/disconnectAfterReading">disconnectAfterReading</a></span></li>
  138. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/disconnectAfterReadingAndWriting">disconnectAfterReadingAndWriting</a></span></li>
  139. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/disconnectAfterWriting">disconnectAfterWriting</a></span></li>
  140. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/enableBackgroundingOnSocket">enableBackgroundingOnSocket</a></span></li>
  141. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/getDelegate:delegateQueue:">getDelegate:delegateQueue:</a></span></li>
  142. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/init">init</a></span></li>
  143. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithDelegate:delegateQueue:">initWithDelegate:delegateQueue:</a></span></li>
  144. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithDelegate:delegateQueue:socketQueue:">initWithDelegate:delegateQueue:socketQueue:</a></span></li>
  145. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithSocketQueue:">initWithSocketQueue:</a></span></li>
  146. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isConnected">isConnected</a></span></li>
  147. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isDisconnected">isDisconnected</a></span></li>
  148. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isIPv4">isIPv4</a></span></li>
  149. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isIPv4Enabled">isIPv4Enabled</a></span></li>
  150. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isIPv4PreferredOverIPv6">isIPv4PreferredOverIPv6</a></span></li>
  151. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isIPv6">isIPv6</a></span></li>
  152. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isIPv6Enabled">isIPv6Enabled</a></span></li>
  153. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isSecure">isSecure</a></span></li>
  154. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/localAddress">localAddress</a></span></li>
  155. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/localHost">localHost</a></span></li>
  156. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/localPort">localPort</a></span></li>
  157. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/performBlock:">performBlock:</a></span></li>
  158. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/progressOfReadReturningTag:bytesDone:total:">progressOfReadReturningTag:bytesDone:total:</a></span></li>
  159. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/progressOfWriteReturningTag:bytesDone:total:">progressOfWriteReturningTag:bytesDone:total:</a></span></li>
  160. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataToData:withTimeout:buffer:bufferOffset:maxLength:tag:">readDataToData:withTimeout:buffer:bufferOffset:maxLength:tag:</a></span></li>
  161. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataToData:withTimeout:buffer:bufferOffset:tag:">readDataToData:withTimeout:buffer:bufferOffset:tag:</a></span></li>
  162. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataToData:withTimeout:maxLength:tag:">readDataToData:withTimeout:maxLength:tag:</a></span></li>
  163. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataToData:withTimeout:tag:">readDataToData:withTimeout:tag:</a></span></li>
  164. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataToLength:withTimeout:buffer:bufferOffset:tag:">readDataToLength:withTimeout:buffer:bufferOffset:tag:</a></span></li>
  165. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataToLength:withTimeout:tag:">readDataToLength:withTimeout:tag:</a></span></li>
  166. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataWithTimeout:buffer:bufferOffset:maxLength:tag:">readDataWithTimeout:buffer:bufferOffset:maxLength:tag:</a></span></li>
  167. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataWithTimeout:buffer:bufferOffset:tag:">readDataWithTimeout:buffer:bufferOffset:tag:</a></span></li>
  168. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readDataWithTimeout:tag:">readDataWithTimeout:tag:</a></span></li>
  169. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/readStream">readStream</a></span></li>
  170. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setAutoDisconnectOnClosedReadStream:">setAutoDisconnectOnClosedReadStream:</a></span></li>
  171. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setDelegate:">setDelegate:</a></span></li>
  172. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setDelegate:delegateQueue:">setDelegate:delegateQueue:</a></span></li>
  173. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setDelegateQueue:">setDelegateQueue:</a></span></li>
  174. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setIPv4Enabled:">setIPv4Enabled:</a></span></li>
  175. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setIPv6Enabled:">setIPv6Enabled:</a></span></li>
  176. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setPreferIPv4OverIPv6:">setPreferIPv4OverIPv6:</a></span></li>
  177. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setUserData:">setUserData:</a></span></li>
  178. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket4FD">socket4FD</a></span></li>
  179. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket6FD">socket6FD</a></span></li>
  180. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socketFD">socketFD</a></span></li>
  181. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sslContext">sslContext</a></span></li>
  182. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/startTLS:">startTLS:</a></span></li>
  183. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/synchronouslySetDelegate:">synchronouslySetDelegate:</a></span></li>
  184. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/synchronouslySetDelegate:delegateQueue:">synchronouslySetDelegate:delegateQueue:</a></span></li>
  185. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/synchronouslySetDelegateQueue:">synchronouslySetDelegateQueue:</a></span></li>
  186. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/userData">userData</a></span></li>
  187. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/writeData:withTimeout:tag:">writeData:withTimeout:tag:</a></span></li>
  188. <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/writeStream">writeStream</a></span></li>
  189. </ul></li>
  190. </ul>
  191. </nav>
  192. <article>
  193. <div id="contents" class="isShowingTOC" role="main">
  194. <a title="GCDAsyncSocket Class Reference" name="top"></a>
  195. <div class="main-navigation navigation-top">
  196. <ul>
  197. <li><a href="../index.html">Index</a></li>
  198. <li><a href="../hierarchy.html">Hierarchy</a></li>
  199. </ul>
  200. </div>
  201. <div id="header">
  202. <div class="section-header">
  203. <h1 class="title title-header">GCDAsyncSocket Class Reference</h1>
  204. </div>
  205. </div>
  206. <div id="container">
  207. <div class="section section-specification"><table cellspacing="0"><tbody>
  208. <tr>
  209. <td class="specification-title">Inherits from</td>
  210. <td class="specification-value">NSObject</td>
  211. </tr><tr>
  212. <td class="specification-title">Declared in</td>
  213. <td class="specification-value">GCDAsyncSocket.h</td>
  214. </tr>
  215. </tbody></table></div>
  216. <div class="section section-tasks">
  217. <a title="Tasks" name="tasks"></a>
  218. <h2 class="subtitle subtitle-tasks">Tasks</h2>
  219. <ul class="task-list">
  220. <li>
  221. <span class="tooltip">
  222. <code><a href="#//api/name/init">&ndash;&nbsp;init</a></code>
  223. <span class="tooltip"><p>GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> uses the standard <a href="#//api/name/delegate">delegate</a> paradigm,<br/>
  224. but executes all <a href="#//api/name/delegate">delegate</a> callbacks on a given <a href="#//api/name/delegate">delegate</a> dispatch queue.<br/>
  225. This allows for maximum concurrency, while at the same time providing easy thread safety.</p></span>
  226. </span>
  227. </li><li>
  228. <span class="tooltip">
  229. <code><a href="#//api/name/initWithSocketQueue:">&ndash;&nbsp;initWithSocketQueue:</a></code>
  230. </span>
  231. </li><li>
  232. <span class="tooltip">
  233. <code><a href="#//api/name/initWithDelegate:delegateQueue:">&ndash;&nbsp;initWithDelegate:delegateQueue:</a></code>
  234. </span>
  235. </li><li>
  236. <span class="tooltip">
  237. <code><a href="#//api/name/initWithDelegate:delegateQueue:socketQueue:">&ndash;&nbsp;initWithDelegate:delegateQueue:socketQueue:</a></code>
  238. </span>
  239. </li><li>
  240. <span class="tooltip">
  241. <code><a href="#//api/name/delegate">&ndash;&nbsp;delegate</a></code>
  242. </span>
  243. </li><li>
  244. <span class="tooltip">
  245. <code><a href="#//api/name/setDelegate:">&ndash;&nbsp;setDelegate:</a></code>
  246. </span>
  247. </li><li>
  248. <span class="tooltip">
  249. <code><a href="#//api/name/synchronouslySetDelegate:">&ndash;&nbsp;synchronouslySetDelegate:</a></code>
  250. </span>
  251. </li><li>
  252. <span class="tooltip">
  253. <code><a href="#//api/name/delegateQueue">&ndash;&nbsp;delegateQueue</a></code>
  254. </span>
  255. </li><li>
  256. <span class="tooltip">
  257. <code><a href="#//api/name/setDelegateQueue:">&ndash;&nbsp;setDelegateQueue:</a></code>
  258. </span>
  259. </li><li>
  260. <span class="tooltip">
  261. <code><a href="#//api/name/synchronouslySetDelegateQueue:">&ndash;&nbsp;synchronouslySetDelegateQueue:</a></code>
  262. </span>
  263. </li><li>
  264. <span class="tooltip">
  265. <code><a href="#//api/name/getDelegate:delegateQueue:">&ndash;&nbsp;getDelegate:delegateQueue:</a></code>
  266. </span>
  267. </li><li>
  268. <span class="tooltip">
  269. <code><a href="#//api/name/setDelegate:delegateQueue:">&ndash;&nbsp;setDelegate:delegateQueue:</a></code>
  270. </span>
  271. </li><li>
  272. <span class="tooltip">
  273. <code><a href="#//api/name/synchronouslySetDelegate:delegateQueue:">&ndash;&nbsp;synchronouslySetDelegate:delegateQueue:</a></code>
  274. </span>
  275. </li><li>
  276. <span class="tooltip">
  277. <code><a href="#//api/name/autoDisconnectOnClosedReadStream">&ndash;&nbsp;autoDisconnectOnClosedReadStream</a></code>
  278. <span class="tooltip"><p>Traditionally sockets are not closed until the conversation is over.<br/>
  279. However, it is technically possible for the remote enpoint to close its write stream.<br/>
  280. Our socket would then be notified that there is no more data to be read,<br/>
  281. but our socket would still be writeable and the remote endpoint could continue to receive our data.</p></span>
  282. </span>
  283. </li><li>
  284. <span class="tooltip">
  285. <code><a href="#//api/name/setAutoDisconnectOnClosedReadStream:">&ndash;&nbsp;setAutoDisconnectOnClosedReadStream:</a></code>
  286. </span>
  287. </li><li>
  288. <span class="tooltip">
  289. <code><a href="#//api/name/isIPv4Enabled">&ndash;&nbsp;isIPv4Enabled</a></code>
  290. <span class="tooltip"><p>By default, both IPv4 and IPv6 are enabled.</p></span>
  291. </span>
  292. </li><li>
  293. <span class="tooltip">
  294. <code><a href="#//api/name/setIPv4Enabled:">&ndash;&nbsp;setIPv4Enabled:</a></code>
  295. </span>
  296. </li><li>
  297. <span class="tooltip">
  298. <code><a href="#//api/name/isIPv6Enabled">&ndash;&nbsp;isIPv6Enabled</a></code>
  299. </span>
  300. </li><li>
  301. <span class="tooltip">
  302. <code><a href="#//api/name/setIPv6Enabled:">&ndash;&nbsp;setIPv6Enabled:</a></code>
  303. </span>
  304. </li><li>
  305. <span class="tooltip">
  306. <code><a href="#//api/name/isIPv4PreferredOverIPv6">&ndash;&nbsp;isIPv4PreferredOverIPv6</a></code>
  307. </span>
  308. </li><li>
  309. <span class="tooltip">
  310. <code><a href="#//api/name/setPreferIPv4OverIPv6:">&ndash;&nbsp;setPreferIPv4OverIPv6:</a></code>
  311. </span>
  312. </li><li>
  313. <span class="tooltip">
  314. <code><a href="#//api/name/userData">&ndash;&nbsp;userData</a></code>
  315. <span class="tooltip"><p>User data allows you to associate arbitrary information with the socket.<br/>
  316. This data is not used internally by socket in any way.</p></span>
  317. </span>
  318. </li><li>
  319. <span class="tooltip">
  320. <code><a href="#//api/name/setUserData:">&ndash;&nbsp;setUserData:</a></code>
  321. </span>
  322. </li><li>
  323. <span class="tooltip">
  324. <code><a href="#//api/name/acceptOnPort:error:">&ndash;&nbsp;acceptOnPort:error:</a></code>
  325. <span class="tooltip"><p>Tells the socket to begin listening and accepting connections on the given port.<br/>
  326. When a connection is accepted, a new instance of GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> will be spawned to handle it,<br/>
  327. and the socket:didAcceptNewSocket: <a href="#//api/name/delegate">delegate</a> method will be invoked.</p></span>
  328. </span>
  329. </li><li>
  330. <span class="tooltip">
  331. <code><a href="#//api/name/acceptOnInterface:port:error:">&ndash;&nbsp;acceptOnInterface:port:error:</a></code>
  332. <span class="tooltip"><p>This method is the same as <a href="#//api/name/acceptOnPort:error:">acceptOnPort:error:</a> with the<br/>
  333. additional option of specifying which interface to listen on.</p></span>
  334. </span>
  335. </li><li>
  336. <span class="tooltip">
  337. <code><a href="#//api/name/connectToHost:onPort:error:">&ndash;&nbsp;connectToHost:onPort:error:</a></code>
  338. <span class="tooltip"><p>Connects to the given host and port.</p></span>
  339. </span>
  340. </li><li>
  341. <span class="tooltip">
  342. <code><a href="#//api/name/connectToHost:onPort:withTimeout:error:">&ndash;&nbsp;connectToHost:onPort:withTimeout:error:</a></code>
  343. <span class="tooltip"><p>Connects to the given host and port with an optional timeout.</p></span>
  344. </span>
  345. </li><li>
  346. <span class="tooltip">
  347. <code><a href="#//api/name/connectToHost:onPort:viaInterface:withTimeout:error:">&ndash;&nbsp;connectToHost:onPort:viaInterface:withTimeout:error:</a></code>
  348. <span class="tooltip"><p>Connects to the given host &amp; port, via the optional interface, with an optional timeout.</p></span>
  349. </span>
  350. </li><li>
  351. <span class="tooltip">
  352. <code><a href="#//api/name/connectToAddress:error:">&ndash;&nbsp;connectToAddress:error:</a></code>
  353. <span class="tooltip"><p>Connects to the given address, specified as a sockaddr structure wrapped in a NSData object.<br/>
  354. For example, a NSData object returned from NSNetService&rsquo;s addresses method.</p></span>
  355. </span>
  356. </li><li>
  357. <span class="tooltip">
  358. <code><a href="#//api/name/connectToAddress:withTimeout:error:">&ndash;&nbsp;connectToAddress:withTimeout:error:</a></code>
  359. <span class="tooltip"><p>This method is the same as <a href="#//api/name/connectToAddress:error:">connectToAddress:error:</a> with an additional timeout option.<br/>
  360. To not time out use a negative time interval, or simply use the <a href="#//api/name/connectToAddress:error:">connectToAddress:error:</a> method.</p></span>
  361. </span>
  362. </li><li>
  363. <span class="tooltip">
  364. <code><a href="#//api/name/connectToAddress:viaInterface:withTimeout:error:">&ndash;&nbsp;connectToAddress:viaInterface:withTimeout:error:</a></code>
  365. <span class="tooltip"><p>Connects to the given address, using the specified interface and timeout.</p></span>
  366. </span>
  367. </li><li>
  368. <span class="tooltip">
  369. <code><a href="#//api/name/disconnect">&ndash;&nbsp;disconnect</a></code>
  370. <span class="tooltip"><p>Disconnects immediately (synchronously). Any pending reads or writes are dropped.</p></span>
  371. </span>
  372. </li><li>
  373. <span class="tooltip">
  374. <code><a href="#//api/name/disconnectAfterReading">&ndash;&nbsp;disconnectAfterReading</a></code>
  375. <span class="tooltip"><p>Disconnects after all pending reads have completed.<br/>
  376. After calling this, the read and write methods will do nothing.<br/>
  377. The socket will <a href="#//api/name/disconnect">disconnect</a> even if there are still pending writes.</p></span>
  378. </span>
  379. </li><li>
  380. <span class="tooltip">
  381. <code><a href="#//api/name/disconnectAfterWriting">&ndash;&nbsp;disconnectAfterWriting</a></code>
  382. <span class="tooltip"><p>Disconnects after all pending writes have completed.<br/>
  383. After calling this, the read and write methods will do nothing.<br/>
  384. The socket will <a href="#//api/name/disconnect">disconnect</a> even if there are still pending reads.</p></span>
  385. </span>
  386. </li><li>
  387. <span class="tooltip">
  388. <code><a href="#//api/name/disconnectAfterReadingAndWriting">&ndash;&nbsp;disconnectAfterReadingAndWriting</a></code>
  389. <span class="tooltip"><p>Disconnects after all pending reads and writes have completed.<br/>
  390. After calling this, the read and write methods will do nothing.</p></span>
  391. </span>
  392. </li><li>
  393. <span class="tooltip">
  394. <code><a href="#//api/name/isDisconnected">&ndash;&nbsp;isDisconnected</a></code>
  395. <span class="tooltip"><p>Returns whether the socket is disconnected or connected.</p></span>
  396. </span>
  397. </li><li>
  398. <span class="tooltip">
  399. <code><a href="#//api/name/isConnected">&ndash;&nbsp;isConnected</a></code>
  400. </span>
  401. </li><li>
  402. <span class="tooltip">
  403. <code><a href="#//api/name/connectedHost">&ndash;&nbsp;connectedHost</a></code>
  404. <span class="tooltip"><p>Returns the local or remote host and port to which this socket is connected, or nil and 0 if not connected.<br/>
  405. The host will be an IP address.</p></span>
  406. </span>
  407. </li><li>
  408. <span class="tooltip">
  409. <code><a href="#//api/name/connectedPort">&ndash;&nbsp;connectedPort</a></code>
  410. </span>
  411. </li><li>
  412. <span class="tooltip">
  413. <code><a href="#//api/name/localHost">&ndash;&nbsp;localHost</a></code>
  414. </span>
  415. </li><li>
  416. <span class="tooltip">
  417. <code><a href="#//api/name/localPort">&ndash;&nbsp;localPort</a></code>
  418. </span>
  419. </li><li>
  420. <span class="tooltip">
  421. <code><a href="#//api/name/connectedAddress">&ndash;&nbsp;connectedAddress</a></code>
  422. <span class="tooltip"><p>Returns the local or remote address to which this socket is connected,<br/>
  423. specified as a sockaddr structure wrapped in a NSData object.</p></span>
  424. </span>
  425. </li><li>
  426. <span class="tooltip">
  427. <code><a href="#//api/name/localAddress">&ndash;&nbsp;localAddress</a></code>
  428. </span>
  429. </li><li>
  430. <span class="tooltip">
  431. <code><a href="#//api/name/isIPv4">&ndash;&nbsp;isIPv4</a></code>
  432. <span class="tooltip"><p>Returns whether the socket is IPv4 or IPv6.<br/>
  433. An accepting socket may be both.</p></span>
  434. </span>
  435. </li><li>
  436. <span class="tooltip">
  437. <code><a href="#//api/name/isIPv6">&ndash;&nbsp;isIPv6</a></code>
  438. </span>
  439. </li><li>
  440. <span class="tooltip">
  441. <code><a href="#//api/name/isSecure">&ndash;&nbsp;isSecure</a></code>
  442. <span class="tooltip"><p>Returns whether or not the socket has been secured via SSL/TLS.</p></span>
  443. </span>
  444. </li><li>
  445. <span class="tooltip">
  446. <code><a href="#//api/name/readDataWithTimeout:tag:">&ndash;&nbsp;readDataWithTimeout:tag:</a></code>
  447. <span class="tooltip"><p>Reads the first available bytes that become available on the socket.</p></span>
  448. </span>
  449. </li><li>
  450. <span class="tooltip">
  451. <code><a href="#//api/name/readDataWithTimeout:buffer:bufferOffset:tag:">&ndash;&nbsp;readDataWithTimeout:buffer:bufferOffset:tag:</a></code>
  452. <span class="tooltip"><p>Reads the first available bytes that become available on the socket.<br/>
  453. The bytes will be appended to the given byte buffer starting at the given offset.<br/>
  454. The given buffer will automatically be increased in size if needed.</p></span>
  455. </span>
  456. </li><li>
  457. <span class="tooltip">
  458. <code><a href="#//api/name/readDataWithTimeout:buffer:bufferOffset:maxLength:tag:">&ndash;&nbsp;readDataWithTimeout:buffer:bufferOffset:maxLength:tag:</a></code>
  459. <span class="tooltip"><p>Reads the first available bytes that become available on the socket.<br/>
  460. The bytes will be appended to the given byte buffer starting at the given offset.<br/>
  461. The given buffer will automatically be increased in size if needed.<br/>
  462. A maximum of length bytes will be read.</p></span>
  463. </span>
  464. </li><li>
  465. <span class="tooltip">
  466. <code><a href="#//api/name/readDataToLength:withTimeout:tag:">&ndash;&nbsp;readDataToLength:withTimeout:tag:</a></code>
  467. <span class="tooltip"><p>Reads the given number of bytes.</p></span>
  468. </span>
  469. </li><li>
  470. <span class="tooltip">
  471. <code><a href="#//api/name/readDataToLength:withTimeout:buffer:bufferOffset:tag:">&ndash;&nbsp;readDataToLength:withTimeout:buffer:bufferOffset:tag:</a></code>
  472. <span class="tooltip"><p>Reads the given number of bytes.<br/>
  473. The bytes will be appended to the given byte buffer starting at the given offset.<br/>
  474. The given buffer will automatically be increased in size if needed.</p></span>
  475. </span>
  476. </li><li>
  477. <span class="tooltip">
  478. <code><a href="#//api/name/readDataToData:withTimeout:tag:">&ndash;&nbsp;readDataToData:withTimeout:tag:</a></code>
  479. <span class="tooltip"><p>Reads bytes until (and including) the passed &ldquo;data&rdquo; parameter, which acts as a separator.</p></span>
  480. </span>
  481. </li><li>
  482. <span class="tooltip">
  483. <code><a href="#//api/name/readDataToData:withTimeout:buffer:bufferOffset:tag:">&ndash;&nbsp;readDataToData:withTimeout:buffer:bufferOffset:tag:</a></code>
  484. <span class="tooltip"><p>Reads bytes until (and including) the passed &ldquo;data&rdquo; parameter, which acts as a separator.<br/>
  485. The bytes will be appended to the given byte buffer starting at the given offset.<br/>
  486. The given buffer will automatically be increased in size if needed.</p></span>
  487. </span>
  488. </li><li>
  489. <span class="tooltip">
  490. <code><a href="#//api/name/readDataToData:withTimeout:maxLength:tag:">&ndash;&nbsp;readDataToData:withTimeout:maxLength:tag:</a></code>
  491. <span class="tooltip"><p>Reads bytes until (and including) the passed &ldquo;data&rdquo; parameter, which acts as a separator.</p></span>
  492. </span>
  493. </li><li>
  494. <span class="tooltip">
  495. <code><a href="#//api/name/readDataToData:withTimeout:buffer:bufferOffset:maxLength:tag:">&ndash;&nbsp;readDataToData:withTimeout:buffer:bufferOffset:maxLength:tag:</a></code>
  496. <span class="tooltip"><p>Reads bytes until (and including) the passed &ldquo;data&rdquo; parameter, which acts as a separator.<br/>
  497. The bytes will be appended to the given byte buffer starting at the given offset.<br/>
  498. The given buffer will automatically be increased in size if needed.</p></span>
  499. </span>
  500. </li><li>
  501. <span class="tooltip">
  502. <code><a href="#//api/name/progressOfReadReturningTag:bytesDone:total:">&ndash;&nbsp;progressOfReadReturningTag:bytesDone:total:</a></code>
  503. <span class="tooltip"><p>Returns progress of the current read, from 0.0 to 1.0, or NaN if no current read (use isnan() to check).<br/>
  504. The parameters &ldquo;tag&rdquo;, &ldquo;done&rdquo; and &ldquo;total&rdquo; will be filled in if they aren&rsquo;t NULL.</p></span>
  505. </span>
  506. </li><li>
  507. <span class="tooltip">
  508. <code><a href="#//api/name/writeData:withTimeout:tag:">&ndash;&nbsp;writeData:withTimeout:tag:</a></code>
  509. <span class="tooltip"><p>Writes data to the socket, and calls the <a href="#//api/name/delegate">delegate</a> when finished.</p></span>
  510. </span>
  511. </li><li>
  512. <span class="tooltip">
  513. <code><a href="#//api/name/progressOfWriteReturningTag:bytesDone:total:">&ndash;&nbsp;progressOfWriteReturningTag:bytesDone:total:</a></code>
  514. <span class="tooltip"><p>Returns progress of the current write, from 0.0 to 1.0, or NaN if no current write (use isnan() to check).<br/>
  515. The parameters &ldquo;tag&rdquo;, &ldquo;done&rdquo; and &ldquo;total&rdquo; will be filled in if they aren&rsquo;t NULL.</p></span>
  516. </span>
  517. </li><li>
  518. <span class="tooltip">
  519. <code><a href="#//api/name/startTLS:">&ndash;&nbsp;startTLS:</a></code>
  520. <span class="tooltip"><p>Secures the connection using SSL/TLS.</p></span>
  521. </span>
  522. </li><li>
  523. <span class="tooltip">
  524. <code><a href="#//api/name/performBlock:">&ndash;&nbsp;performBlock:</a></code>
  525. <span class="tooltip"><p>It&rsquo;s not thread-safe to access certain variables from outside the socket&rsquo;s internal queue.</p></span>
  526. </span>
  527. </li><li>
  528. <span class="tooltip">
  529. <code><a href="#//api/name/socketFD">&ndash;&nbsp;socketFD</a></code>
  530. <span class="tooltip"><p>These methods are only available from within the context of a <a href="#//api/name/performBlock:">performBlock:</a> invocation.<br/>
  531. See the documentation for the <a href="#//api/name/performBlock:">performBlock:</a> method above.</p></span>
  532. </span>
  533. </li><li>
  534. <span class="tooltip">
  535. <code><a href="#//api/name/socket4FD">&ndash;&nbsp;socket4FD</a></code>
  536. </span>
  537. </li><li>
  538. <span class="tooltip">
  539. <code><a href="#//api/name/socket6FD">&ndash;&nbsp;socket6FD</a></code>
  540. </span>
  541. </li><li>
  542. <span class="tooltip">
  543. <code><a href="#//api/name/readStream">&ndash;&nbsp;readStream</a></code>
  544. <span class="tooltip"><p>These methods are only available from within the context of a <a href="#//api/name/performBlock:">performBlock:</a> invocation.<br/>
  545. See the documentation for the <a href="#//api/name/performBlock:">performBlock:</a> method above.</p></span>
  546. </span>
  547. </li><li>
  548. <span class="tooltip">
  549. <code><a href="#//api/name/writeStream">&ndash;&nbsp;writeStream</a></code>
  550. </span>
  551. </li><li>
  552. <span class="tooltip">
  553. <code><a href="#//api/name/enableBackgroundingOnSocket">&ndash;&nbsp;enableBackgroundingOnSocket</a></code>
  554. <span class="tooltip"><p>This method is only available from within the context of a <a href="#//api/name/performBlock:">performBlock:</a> invocation.<br/>
  555. See the documentation for the <a href="#//api/name/performBlock:">performBlock:</a> method above.</p></span>
  556. </span>
  557. </li><li>
  558. <span class="tooltip">
  559. <code><a href="#//api/name/sslContext">&ndash;&nbsp;sslContext</a></code>
  560. <span class="tooltip"><p>This method is only available from within the context of a <a href="#//api/name/performBlock:">performBlock:</a> invocation.<br/>
  561. See the documentation for the <a href="#//api/name/performBlock:">performBlock:</a> method above.</p></span>
  562. </span>
  563. </li><li>
  564. <span class="tooltip">
  565. <code><a href="#//api/name/hostFromAddress:">+&nbsp;hostFromAddress:</a></code>
  566. <span class="tooltip"><p>Extracting host and port information from raw address data.</p></span>
  567. </span>
  568. </li><li>
  569. <span class="tooltip">
  570. <code><a href="#//api/name/portFromAddress:">+&nbsp;portFromAddress:</a></code>
  571. </span>
  572. </li><li>
  573. <span class="tooltip">
  574. <code><a href="#//api/name/getHost:port:fromAddress:">+&nbsp;getHost:port:fromAddress:</a></code>
  575. </span>
  576. </li><li>
  577. <span class="tooltip">
  578. <code><a href="#//api/name/CRLFData">+&nbsp;CRLFData</a></code>
  579. <span class="tooltip"><p>A few common line separators, for use with the readDataToData:&hellip; methods.</p></span>
  580. </span>
  581. </li><li>
  582. <span class="tooltip">
  583. <code><a href="#//api/name/CRData">+&nbsp;CRData</a></code>
  584. </span>
  585. </li><li>
  586. <span class="tooltip">
  587. <code><a href="#//api/name/LFData">+&nbsp;LFData</a></code>
  588. </span>
  589. </li><li>
  590. <span class="tooltip">
  591. <code><a href="#//api/name/ZeroData">+&nbsp;ZeroData</a></code>
  592. </span>
  593. </li>
  594. </ul>
  595. </div>
  596. <div class="section section-methods">
  597. <a title="Class Methods" name="class_methods"></a>
  598. <h2 class="subtitle subtitle-methods">Class Methods</h2>
  599. <div class="section-method">
  600. <a name="//api/name/CRData" title="CRData"></a>
  601. <h3 class="subsubtitle method-title">CRData</h3>
  602. <div class="method-subsection method-declaration"><code>+ (NSData *)CRData</code></div>
  603. </div>
  604. <div class="section-method">
  605. <a name="//api/name/CRLFData" title="CRLFData"></a>
  606. <h3 class="subsubtitle method-title">CRLFData</h3>
  607. <div class="method-subsection brief-description">
  608. <p>A few common line separators, for use with the readDataToData:&hellip; methods.</p>
  609. </div>
  610. <div class="method-subsection method-declaration"><code>+ (NSData *)CRLFData</code></div>
  611. <div class="method-subsection discussion-section">
  612. <h4 class="method-subtitle">Discussion</h4>
  613. <p>A few common line separators, for use with the readDataToData:&hellip; methods.</p>
  614. </div>
  615. <div class="method-subsection declared-in-section">
  616. <h4 class="method-subtitle">Declared In</h4>
  617. <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
  618. </div>
  619. </div>
  620. <div class="section-method">
  621. <a name="//api/name/LFData" title="LFData"></a>
  622. <h3 class="subsubtitle method-title">LFData</h3>
  623. <div class="method-subsection method-declaration"><code>+ (NSData *)LFData</code></div>
  624. </div>
  625. <div class="section-method">
  626. <a name="//api/name/ZeroData" title="ZeroData"></a>
  627. <h3 class="subsubtitle method-title">ZeroData</h3>
  628. <div class="method-subsection method-declaration"><code>+ (NSData *)ZeroData</code></div>
  629. </div>
  630. <div class="section-method">
  631. <a name="//api/name/getHost:port:fromAddress:" title="getHost:port:fromAddress:"></a>
  632. <h3 class="subsubtitle method-title">getHost:port:fromAddress:</h3>
  633. <div class="method-subsection method-declaration"><code>+ (BOOL)getHost:(NSString **)<em>hostPtr</em> port:(uint16_t *)<em>portPtr</em> fromAddress:(NSData *)<em>address</em></code></div>
  634. </div>
  635. <div class="section-method">
  636. <a name="//api/name/hostFromAddress:" title="hostFromAddress:"></a>
  637. <h3 class="subsubtitle method-title">hostFromAddress:</h3>
  638. <div class="method-subsection brief-description">
  639. <p>Extracting host and port information from raw address data.</p>
  640. </div>
  641. <div class="method-subsection method-declaration"><code>+ (NSString *)hostFromAddress:(NSData *)<em>address</em></code></div>
  642. <div class="method-subsection discussion-section">
  643. <h4 class="method-subtitle">Discussion</h4>
  644. <p>Extracting host and port information from raw address data.</p>
  645. </div>
  646. <div class="method-subsection declared-in-section">
  647. <h4 class="method-subtitle">Declared In</h4>
  648. <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
  649. </div>
  650. </div>
  651. <div class="section-method">
  652. <a name="//api/name/portFromAddress:" title="portFromAddress:"></a>
  653. <h3 class="subsubtitle method-title">portFromAddress:</h3>
  654. <div class="method-subsection method-declaration"><code>+ (uint16_t)portFromAddress:(NSData *)<em>address</em></code></div>
  655. </div>
  656. </div>
  657. <div class="section section-methods">
  658. <a title="Instance Methods" name="instance_methods"></a>
  659. <h2 class="subtitle subtitle-methods">Instance Methods</h2>
  660. <div class="section-method">
  661. <a name="//api/name/acceptOnInterface:port:error:" title="acceptOnInterface:port:error:"></a>
  662. <h3 class="subsubtitle method-title">acceptOnInterface:port:error:</h3>
  663. <div class="method-subsection brief-description">
  664. <p>This method is the same as <a href="#//api/name/acceptOnPort:error:">acceptOnPort:error:</a> with the<br/>
  665. additional option of specifying which interface to listen on.</p>
  666. </div>
  667. <div class="method-subsection method-declaration"><code>- (BOOL)acceptOnInterface:(NSString *)<em>interface</em> port:(uint16_t)<em>port</em> error:(NSError **)<em>errPtr</em></code></div>
  668. <div class="method-subsection discussion-section">
  669. <h4 class="method-subtitle">Discussion</h4>
  670. <p>This method is the same as <a href="#//api/name/acceptOnPort:error:">acceptOnPort:error:</a> with the<br/>
  671. additional option of specifying which interface to listen on.</p>
  672. <p>For example, you could specify that the socket should only accept connections over ethernet,<br/>
  673. and not other interfaces such as wifi.</p>
  674. <p>The interface may be specified by name (e.g. &ldquo;en1&rdquo; or &ldquo;lo0&rdquo;) or by IP address (e.g. &ldquo;192.168.4.34&rdquo;).<br/>
  675. You may also use the special strings &ldquo;localhost&rdquo; or &ldquo;loopback&rdquo; to specify that<br/>
  676. the socket only accept connections from the local machine.</p>
  677. <p>You can see the list of interfaces via the command line utility &ldquo;ifconfig&rdquo;,<br/>
  678. or programmatically via the getifaddrs() function.</p>
  679. <p>To accept connections on any interface pass nil, or simply use the <a href="#//api/name/acceptOnPort:error:">acceptOnPort:error:</a> method.</p>
  680. </div>
  681. <div class="method-subsection declared-in-section">
  682. <h4 class="method-subtitle">Declared In</h4>
  683. <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
  684. </div>
  685. </div>
  686. <div class="section-method">
  687. <a name="//api/name/acceptOnPort:error:" title="acceptOnPort:error:"></a>
  688. <h3 class="subsubtitle method-title">acceptOnPort:error:</h3>
  689. <div class="method-subsection brief-description">
  690. <p>Tells the socket to begin listening and accepting connections on the given port.<br/>
  691. When a connection is accepted, a new instance of GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> will be spawned to handle it,<br/>
  692. and the socket:didAcceptNewSocket: <a href="#//api/name/delegate">delegate</a> method will be invoked.</p>
  693. </div>
  694. <div class="method-subsection method-declaration"><code>- (BOOL)acceptOnPort:(uint16_t)<em>port</em> error:(NSError **)<em>errPtr</em></code></div>
  695. <div class="method-subsection discussion-section">
  696. <h4 class="method-subtitle">Discussion</h4>
  697. <p>Tells the socket to begin listening and accepting connections on the given port.<br/>
  698. When a connection is accepted, a new instance of GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> will be spawned to handle it,<br/>
  699. and the socket:didAcceptNewSocket: <a href="#//api/name/delegate">delegate</a> method will be invoked.</p>
  700. <p>The socket will listen on all available interfaces (e.g. wifi, ethernet, etc)</p>
  701. </div>
  702. <div class="method-subsection declared-in-section">
  703. <h4 class="method-subtitle">Declared In</h4>
  704. <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
  705. </div>
  706. </div>
  707. <div class="section-method">
  708. <a name="//api/name/autoDisconnectOnClosedReadStream" title="autoDisconnectOnClosedReadStream"></a>
  709. <h3 class="subsubtitle method-title">autoDisconnectOnClosedReadStream</h3>
  710. <div class="method-subsection brief-description">
  711. <p>Traditionally sockets are not closed until the conversation is over.<br/>
  712. However, it is technically possible for the remote enpoint to close its write stream.<br/>
  713. Our socket would then be notified that there is no more data to be read,<br/>
  714. but our socket would still be writeable and the remote endpoint could continue to receive our data.</p>
  715. </div>
  716. <div class="method-subsection method-declaration"><code>- (BOOL)autoDisconnectOnClosedReadStream</code></div>
  717. <div class="method-subsection discussion-section">
  718. <h4 class="method-subtitle">Discussion</h4>
  719. <p>Traditionally sockets are not closed until the conversation is over.<br/>
  720. However, it is technically possible for the remote enpoint to close its write stream.<br/>
  721. Our socket would then be notified that there is no more data to be read,<br/>
  722. but our socket would still be writeable and the remote endpoint could continue to receive our data.</p>
  723. <p>The argument for this confusing functionality stems from the idea that a client could shut down its<br/>
  724. write strea

Large files files are truncated, but you can click here to view the full file