/Pods/Documentation/CocoaAsyncSocket/html/Protocols/GCDAsyncSocketDelegate.html
HTML | 949 lines | 511 code | 438 blank | 0 comment | 0 complexity | d5ce22474c1c4dab86817ba0319a242a MD5 | raw file
Possible License(s): BSD-3-Clause
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
- <title>GCDAsyncSocketDelegate Protocol Reference</title>
- <meta id="xcode-display" name="xcode-display" content="render"/>
- <link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
- <link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
- <meta name="generator" content="appledoc 2.1 (build 858)" />
- </head>
- <body>
- <header id="top_header">
- <div id="library" class="hideInXcode">
- <h1><a id="libraryTitle" href="../index.html">CocoaAsyncSocket 0.0.1 </a></h1>
- <a id="developerHome" href="../index.html">Dustin Voss and Robbie Hanson</a>
- </div>
-
- <div id="title" role="banner">
- <h1 class="hideInXcode">GCDAsyncSocketDelegate Protocol Reference</h1>
- </div>
- <ul id="headerButtons" role="toolbar">
- <li id="toc_button">
- <button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
- </li>
- <li id="jumpto_button" role="navigation">
- <select id="jumpTo">
- <option value="top">Jump To…</option>
-
-
-
-
- <option value="tasks">Tasks</option>
-
-
-
-
-
-
-
-
-
- <option value="instance_methods">Instance Methods</option>
-
- <option value="//api/name/newSocketQueueForConnectionFromAddress:onSocket:"> - newSocketQueueForConnectionFromAddress:onSocket:</option>
-
- <option value="//api/name/socket:didAcceptNewSocket:"> - socket:didAcceptNewSocket:</option>
-
- <option value="//api/name/socket:didConnectToHost:port:"> - socket:didConnectToHost:port:</option>
-
- <option value="//api/name/socket:didReadData:withTag:"> - socket:didReadData:withTag:</option>
-
- <option value="//api/name/socket:didReadPartialDataOfLength:tag:"> - socket:didReadPartialDataOfLength:tag:</option>
-
- <option value="//api/name/socket:didWriteDataWithTag:"> - socket:didWriteDataWithTag:</option>
-
- <option value="//api/name/socket:didWritePartialDataOfLength:tag:"> - socket:didWritePartialDataOfLength:tag:</option>
-
- <option value="//api/name/socket:shouldTimeoutReadWithTag:elapsed:bytesDone:"> - socket:shouldTimeoutReadWithTag:elapsed:bytesDone:</option>
-
- <option value="//api/name/socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:"> - socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:</option>
-
- <option value="//api/name/socketDidCloseReadStream:"> - socketDidCloseReadStream:</option>
-
- <option value="//api/name/socketDidDisconnect:withError:"> - socketDidDisconnect:withError:</option>
-
- <option value="//api/name/socketDidSecure:"> - socketDidSecure:</option>
-
-
-
- </select>
- </li>
- </ul>
- </header>
- <nav id="tocContainer" class="isShowingTOC">
- <ul id="toc" role="tree">
-
- <li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
-
- </ul></li>
- <li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/newSocketQueueForConnectionFromAddress:onSocket:">newSocketQueueForConnectionFromAddress:onSocket:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket:didAcceptNewSocket:">socket:didAcceptNewSocket:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket:didConnectToHost:port:">socket:didConnectToHost:port:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket:didReadData:withTag:">socket:didReadData:withTag:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket:didReadPartialDataOfLength:tag:">socket:didReadPartialDataOfLength:tag:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket:didWriteDataWithTag:">socket:didWriteDataWithTag:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket:didWritePartialDataOfLength:tag:">socket:didWritePartialDataOfLength:tag:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket:shouldTimeoutReadWithTag:elapsed:bytesDone:">socket:shouldTimeoutReadWithTag:elapsed:bytesDone:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:">socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socketDidCloseReadStream:">socketDidCloseReadStream:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socketDidDisconnect:withError:">socketDidDisconnect:withError:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/socketDidSecure:">socketDidSecure:</a></span></li>
-
- </ul></li>
- </ul>
- </nav>
- <article>
- <div id="contents" class="isShowingTOC" role="main">
- <a title="GCDAsyncSocketDelegate Protocol Reference" name="top"></a>
- <div class="main-navigation navigation-top">
- <ul>
- <li><a href="../index.html">Index</a></li>
- <li><a href="../hierarchy.html">Hierarchy</a></li>
- </ul>
- </div>
- <div id="header">
- <div class="section-header">
- <h1 class="title title-header">GCDAsyncSocketDelegate Protocol Reference</h1>
- </div>
- </div>
- <div id="container">
-
- <div class="section section-specification"><table cellspacing="0"><tbody>
- <tr>
- <td class="specification-title">Declared in</td>
- <td class="specification-value">GCDAsyncSocket.h</td>
- </tr>
- </tbody></table></div>
-
-
-
-
-
-
- <div class="section section-tasks">
- <a title="Tasks" name="tasks"></a>
- <h2 class="subtitle subtitle-tasks">Tasks</h2>
-
-
-
-
- <ul class="task-list">
- <li>
- <span class="tooltip">
- <code><a href="#//api/name/newSocketQueueForConnectionFromAddress:onSocket:">– newSocketQueueForConnectionFromAddress:onSocket:</a></code>
- <span class="tooltip"><p>This method is called immediately prior to <a href="#//api/name/socket:didAcceptNewSocket:">socket:didAcceptNewSocket:</a>.<br/>
- It optionally allows a listening socket to specify the socketQueue for a new accepted socket.<br/>
- If this method is not implemented, or returns NULL, the new accepted socket will create its own default queue.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socket:didAcceptNewSocket:">– socket:didAcceptNewSocket:</a></code>
- <span class="tooltip"><p>Called when a socket accepts a connection.<br/>
- Another socket is automatically spawned to handle it.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socket:didConnectToHost:port:">– socket:didConnectToHost:port:</a></code>
- <span class="tooltip"><p>Called when a socket connects and is ready for reading and writing.<br/>
- The host parameter will be an IP address, not a DNS name.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socket:didReadData:withTag:">– socket:didReadData:withTag:</a></code>
- <span class="tooltip"><p>Called when a socket has completed reading the requested data into memory.<br/>
- Not called if there is an error.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socket:didReadPartialDataOfLength:tag:">– socket:didReadPartialDataOfLength:tag:</a></code>
- <span class="tooltip"><p>Called when a socket has read in data, but has not yet completed the read.<br/>
- This would occur if using readToData: or readToLength: methods.<br/>
- It may be used to for things such as updating progress bars.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socket:didWriteDataWithTag:">– socket:didWriteDataWithTag:</a></code>
- <span class="tooltip"><p>Called when a socket has completed writing the requested data. Not called if there is an error.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socket:didWritePartialDataOfLength:tag:">– socket:didWritePartialDataOfLength:tag:</a></code>
- <span class="tooltip"><p>Called when a socket has written some data, but has not yet completed the entire write.<br/>
- It may be used to for things such as updating progress bars.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socket:shouldTimeoutReadWithTag:elapsed:bytesDone:">– socket:shouldTimeoutReadWithTag:elapsed:bytesDone:</a></code>
- <span class="tooltip"><p>Called if a read operation has reached its timeout without completing.<br/>
- This method allows you to optionally extend the timeout.<br/>
- If you return a positive time interval (> 0) the read’s timeout will be extended by the given amount.<br/>
- If you don’t implement this method, or return a non-positive time interval (<= 0) the read will timeout as usual.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:">– socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:</a></code>
- <span class="tooltip"><p>Called if a write operation has reached its timeout without completing.<br/>
- This method allows you to optionally extend the timeout.<br/>
- If you return a positive time interval (> 0) the write’s timeout will be extended by the given amount.<br/>
- If you don’t implement this method, or return a non-positive time interval (<= 0) the write will timeout as usual.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socketDidCloseReadStream:">– socketDidCloseReadStream:</a></code>
- <span class="tooltip"><p>Conditionally called if the read stream closes, but the write stream may still be writeable.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socketDidDisconnect:withError:">– socketDidDisconnect:withError:</a></code>
- <span class="tooltip"><p>Called when a socket disconnects with or without error.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/socketDidSecure:">– socketDidSecure:</a></code>
- <span class="tooltip"><p>Called after the socket has successfully completed SSL/TLS negotiation.<br/>
- This method is not called unless you use the provided startTLS method.</p></span>
- </span>
-
-
- </li>
- </ul>
-
- </div>
-
-
-
-
-
-
-
-
-
- <div class="section section-methods">
- <a title="Instance Methods" name="instance_methods"></a>
- <h2 class="subtitle subtitle-methods">Instance Methods</h2>
-
- <div class="section-method">
- <a name="//api/name/newSocketQueueForConnectionFromAddress:onSocket:" title="newSocketQueueForConnectionFromAddress:onSocket:"></a>
- <h3 class="subsubtitle method-title">newSocketQueueForConnectionFromAddress:onSocket:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>This method is called immediately prior to <a href="#//api/name/socket:didAcceptNewSocket:">socket:didAcceptNewSocket:</a>.<br/>
- It optionally allows a listening socket to specify the socketQueue for a new accepted socket.<br/>
- If this method is not implemented, or returns NULL, the new accepted socket will create its own default queue.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (dispatch_queue_t)newSocketQueueForConnectionFromAddress:(NSData *)<em>address</em> onSocket:(GCDAsyncSocket *)<em>sock</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>This method is called immediately prior to <a href="#//api/name/socket:didAcceptNewSocket:">socket:didAcceptNewSocket:</a>.<br/>
- It optionally allows a listening socket to specify the socketQueue for a new accepted socket.<br/>
- If this method is not implemented, or returns NULL, the new accepted socket will create its own default queue.</p>
- <p>Since you cannot autorelease a dispatch_queue,<br/>
- this method uses the “new” prefix in its name to specify that the returned queue has been retained.</p>
- <p>Thus you could do something like this in the implementation:<br/>
- return dispatch_queue_create(“MyQueue”, NULL);</p>
- <p>If you are placing multiple sockets on the same queue,<br/>
- then care should be taken to increment the retain count each time this method is invoked.</p>
- <p>For example, your implementation might look something like this:<br/>
- dispatch_retain(myExistingQueue);<br/>
- return myExistingQueue;</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socket:didAcceptNewSocket:" title="socket:didAcceptNewSocket:"></a>
- <h3 class="subsubtitle method-title">socket:didAcceptNewSocket:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called when a socket accepts a connection.<br/>
- Another socket is automatically spawned to handle it.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socket:(GCDAsyncSocket *)<em>sock</em> didAcceptNewSocket:(GCDAsyncSocket *)<em>newSocket</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called when a socket accepts a connection.<br/>
- Another socket is automatically spawned to handle it.</p>
- <p>You must retain the newSocket if you wish to handle the connection.<br/>
- Otherwise the newSocket instance will be released and the spawned connection will be closed.</p>
- <p>By default the new socket will have the same delegate and delegateQueue.<br/>
- You may, of course, change this at any time.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socket:didConnectToHost:port:" title="socket:didConnectToHost:port:"></a>
- <h3 class="subsubtitle method-title">socket:didConnectToHost:port:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called when a socket connects and is ready for reading and writing.<br/>
- The host parameter will be an IP address, not a DNS name.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socket:(GCDAsyncSocket *)<em>sock</em> didConnectToHost:(NSString *)<em>host</em> port:(uint16_t)<em>port</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called when a socket connects and is ready for reading and writing.<br/>
- The host parameter will be an IP address, not a DNS name.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socket:didReadData:withTag:" title="socket:didReadData:withTag:"></a>
- <h3 class="subsubtitle method-title">socket:didReadData:withTag:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called when a socket has completed reading the requested data into memory.<br/>
- Not called if there is an error.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socket:(GCDAsyncSocket *)<em>sock</em> didReadData:(NSData *)<em>data</em> withTag:(long)<em>tag</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called when a socket has completed reading the requested data into memory.<br/>
- Not called if there is an error.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socket:didReadPartialDataOfLength:tag:" title="socket:didReadPartialDataOfLength:tag:"></a>
- <h3 class="subsubtitle method-title">socket:didReadPartialDataOfLength:tag:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called when a socket has read in data, but has not yet completed the read.<br/>
- This would occur if using readToData: or readToLength: methods.<br/>
- It may be used to for things such as updating progress bars.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socket:(GCDAsyncSocket *)<em>sock</em> didReadPartialDataOfLength:(NSUInteger)<em>partialLength</em> tag:(long)<em>tag</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called when a socket has read in data, but has not yet completed the read.<br/>
- This would occur if using readToData: or readToLength: methods.<br/>
- It may be used to for things such as updating progress bars.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socket:didWriteDataWithTag:" title="socket:didWriteDataWithTag:"></a>
- <h3 class="subsubtitle method-title">socket:didWriteDataWithTag:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called when a socket has completed writing the requested data. Not called if there is an error.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socket:(GCDAsyncSocket *)<em>sock</em> didWriteDataWithTag:(long)<em>tag</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called when a socket has completed writing the requested data. Not called if there is an error.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socket:didWritePartialDataOfLength:tag:" title="socket:didWritePartialDataOfLength:tag:"></a>
- <h3 class="subsubtitle method-title">socket:didWritePartialDataOfLength:tag:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called when a socket has written some data, but has not yet completed the entire write.<br/>
- It may be used to for things such as updating progress bars.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socket:(GCDAsyncSocket *)<em>sock</em> didWritePartialDataOfLength:(NSUInteger)<em>partialLength</em> tag:(long)<em>tag</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called when a socket has written some data, but has not yet completed the entire write.<br/>
- It may be used to for things such as updating progress bars.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socket:shouldTimeoutReadWithTag:elapsed:bytesDone:" title="socket:shouldTimeoutReadWithTag:elapsed:bytesDone:"></a>
- <h3 class="subsubtitle method-title">socket:shouldTimeoutReadWithTag:elapsed:bytesDone:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called if a read operation has reached its timeout without completing.<br/>
- This method allows you to optionally extend the timeout.<br/>
- If you return a positive time interval (> 0) the read’s timeout will be extended by the given amount.<br/>
- If you don’t implement this method, or return a non-positive time interval (<= 0) the read will timeout as usual.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (NSTimeInterval)socket:(GCDAsyncSocket *)<em>sock</em> shouldTimeoutReadWithTag:(long)<em>tag</em> elapsed:(NSTimeInterval)<em>elapsed</em> bytesDone:(NSUInteger)<em>length</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called if a read operation has reached its timeout without completing.<br/>
- This method allows you to optionally extend the timeout.<br/>
- If you return a positive time interval (> 0) the read’s timeout will be extended by the given amount.<br/>
- If you don’t implement this method, or return a non-positive time interval (<= 0) the read will timeout as usual.</p>
- <p>The elapsed parameter is the sum of the original timeout, plus any additions previously added via this method.<br/>
- The length parameter is the number of bytes that have been read so far for the read operation.</p>
- <p>Note that this method may be called multiple times for a single read if you return positive numbers.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:" title="socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:"></a>
- <h3 class="subsubtitle method-title">socket:shouldTimeoutWriteWithTag:elapsed:bytesDone:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called if a write operation has reached its timeout without completing.<br/>
- This method allows you to optionally extend the timeout.<br/>
- If you return a positive time interval (> 0) the write’s timeout will be extended by the given amount.<br/>
- If you don’t implement this method, or return a non-positive time interval (<= 0) the write will timeout as usual.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (NSTimeInterval)socket:(GCDAsyncSocket *)<em>sock</em> shouldTimeoutWriteWithTag:(long)<em>tag</em> elapsed:(NSTimeInterval)<em>elapsed</em> bytesDone:(NSUInteger)<em>length</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called if a write operation has reached its timeout without completing.<br/>
- This method allows you to optionally extend the timeout.<br/>
- If you return a positive time interval (> 0) the write’s timeout will be extended by the given amount.<br/>
- If you don’t implement this method, or return a non-positive time interval (<= 0) the write will timeout as usual.</p>
- <p>The elapsed parameter is the sum of the original timeout, plus any additions previously added via this method.<br/>
- The length parameter is the number of bytes that have been written so far for the write operation.</p>
- <p>Note that this method may be called multiple times for a single write if you return positive numbers.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socketDidCloseReadStream:" title="socketDidCloseReadStream:"></a>
- <h3 class="subsubtitle method-title">socketDidCloseReadStream:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Conditionally called if the read stream closes, but the write stream may still be writeable.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socketDidCloseReadStream:(GCDAsyncSocket *)<em>sock</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Conditionally called if the read stream closes, but the write stream may still be writeable.</p>
- <p>This delegate method is only called if autoDisconnectOnClosedReadStream has been set to NO.<br/>
- See the discussion on the autoDisconnectOnClosedReadStream method for more information.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socketDidDisconnect:withError:" title="socketDidDisconnect:withError:"></a>
- <h3 class="subsubtitle method-title">socketDidDisconnect:withError:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called when a socket disconnects with or without error.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socketDidDisconnect:(GCDAsyncSocket *)<em>sock</em> withError:(NSError *)<em>err</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called when a socket disconnects with or without error.</p>
- <p>If you call the disconnect method, and the socket wasn’t already disconnected,<br/>
- this delegate method will be called before the disconnect method returns.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/socketDidSecure:" title="socketDidSecure:"></a>
- <h3 class="subsubtitle method-title">socketDidSecure:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Called after the socket has successfully completed SSL/TLS negotiation.<br/>
- This method is not called unless you use the provided startTLS method.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)socketDidSecure:(GCDAsyncSocket *)<em>sock</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Called after the socket has successfully completed SSL/TLS negotiation.<br/>
- This method is not called unless you use the provided startTLS method.</p>
- <p>If a SSL/TLS negotiation fails (invalid certificate, etc) then the socket will immediately close,<br/>
- and the <a href="#//api/name/socketDidDisconnect:withError:">socketDidDisconnect:withError:</a> delegate method will be called with the specific SSL error code.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">GCDAsyncSocket.h</code><br />
- </div>
-
-
- </div>
-
- </div>
-
-
- </div>
- <div class="main-navigation navigation-bottom">
- <ul>
- <li><a href="../index.html">Index</a></li>
- <li><a href="../hierarchy.html">Hierarchy</a></li>
- </ul>
- </div>
- <div id="footer">
- <hr />
- <div class="footer-copyright">
- <p><span class="copyright">© 2013 Dustin Voss and Robbie Hanson. All rights reserved. (Last updated: 2013-04-24)</span><br />
-
- <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.1 (build 858)</a>.</span></p>
-
- </div>
- </div>
- </div>
- </article>
- <script type="text/javascript">
- function jumpToChange()
- {
- window.location.hash = this.options[this.selectedIndex].value;
- }
-
- function toggleTOC()
- {
- var contents = document.getElementById('contents');
- var tocContainer = document.getElementById('tocContainer');
-
- if (this.getAttribute('class') == 'open')
- {
- this.setAttribute('class', '');
- contents.setAttribute('class', '');
- tocContainer.setAttribute('class', '');
-
- window.name = "hideTOC";
- }
- else
- {
- this.setAttribute('class', 'open');
- contents.setAttribute('class', 'isShowingTOC');
- tocContainer.setAttribute('class', 'isShowingTOC');
-
- window.name = "";
- }
- return false;
- }
-
- function toggleTOCEntryChildren(e)
- {
- e.stopPropagation();
- var currentClass = this.getAttribute('class');
- if (currentClass == 'children') {
- this.setAttribute('class', 'children open');
- }
- else if (currentClass == 'children open') {
- this.setAttribute('class', 'children');
- }
- return false;
- }
-
- function tocEntryClick(e)
- {
- e.stopPropagation();
- return true;
- }
-
- function init()
- {
- var selectElement = document.getElementById('jumpTo');
- selectElement.addEventListener('change', jumpToChange, false);
-
- var tocButton = document.getElementById('table_of_contents');
- tocButton.addEventListener('click', toggleTOC, false);
-
- var taskTreeItem = document.getElementById('task_treeitem');
- if (taskTreeItem.getElementsByTagName('li').length > 0)
- {
- taskTreeItem.setAttribute('class', 'children');
- taskTreeItem.firstChild.setAttribute('class', 'disclosure');
- }
-
- var tocList = document.getElementById('toc');
-
- var tocEntries = tocList.getElementsByTagName('li');
- for (var i = 0; i < tocEntries.length; i++) {
- tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
- }
-
- var tocLinks = tocList.getElementsByTagName('a');
- for (var i = 0; i < tocLinks.length; i++) {
- tocLinks[i].addEventListener('click', tocEntryClick, false);
- }
-
- if (window.name == "hideTOC") {
- toggleTOC.call(tocButton);
- }
- }
-
- window.onload = init;
-
- // If showing in Xcode, hide the TOC and Header
- if (navigator.userAgent.match(/xcode/i)) {
- document.getElementById("contents").className = "hideInXcode"
- document.getElementById("tocContainer").className = "hideInXcode"
- document.getElementById("top_header").className = "hideInXcode"
- }
-
- </script>
- </body>
- </html>