/Pods/Documentation/CocoaAsyncSocket/html/Classes/AsyncUdpSocket.html
HTML | 1995 lines | 1023 code | 972 blank | 0 comment | 0 complexity | 29704a17a6034f3109fdae163273348b 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>AsyncUdpSocket Class 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">AsyncUdpSocket Class 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/bindToAddress:port:error:"> - bindToAddress:port:error:</option>
-
- <option value="//api/name/bindToPort:error:"> - bindToPort:error:</option>
-
- <option value="//api/name/close"> - close</option>
-
- <option value="//api/name/closeAfterReceiving"> - closeAfterReceiving</option>
-
- <option value="//api/name/closeAfterSending"> - closeAfterSending</option>
-
- <option value="//api/name/closeAfterSendingAndReceiving"> - closeAfterSendingAndReceiving</option>
-
- <option value="//api/name/connectToAddress:error:"> - connectToAddress:error:</option>
-
- <option value="//api/name/connectToHost:onPort:error:"> - connectToHost:onPort:error:</option>
-
- <option value="//api/name/connectedHost"> - connectedHost</option>
-
- <option value="//api/name/connectedPort"> - connectedPort</option>
-
- <option value="//api/name/delegate"> - delegate</option>
-
- <option value="//api/name/enableBroadcast:error:"> - enableBroadcast:error:</option>
-
- <option value="//api/name/init"> - init</option>
-
- <option value="//api/name/initIPv4"> - initIPv4</option>
-
- <option value="//api/name/initIPv6"> - initIPv6</option>
-
- <option value="//api/name/initWithDelegate:"> - initWithDelegate:</option>
-
- <option value="//api/name/initWithDelegate:userData:"> - initWithDelegate:userData:</option>
-
- <option value="//api/name/isClosed"> - isClosed</option>
-
- <option value="//api/name/isConnected"> - isConnected</option>
-
- <option value="//api/name/isIPv4"> - isIPv4</option>
-
- <option value="//api/name/isIPv6"> - isIPv6</option>
-
- <option value="//api/name/joinMulticastGroup:error:"> - joinMulticastGroup:error:</option>
-
- <option value="//api/name/joinMulticastGroup:withAddress:error:"> - joinMulticastGroup:withAddress:error:</option>
-
- <option value="//api/name/localHost"> - localHost</option>
-
- <option value="//api/name/localPort"> - localPort</option>
-
- <option value="//api/name/maxReceiveBufferSize"> - maxReceiveBufferSize</option>
-
- <option value="//api/name/maximumTransmissionUnit"> - maximumTransmissionUnit</option>
-
- <option value="//api/name/moveToRunLoop:"> - moveToRunLoop:</option>
-
- <option value="//api/name/receiveWithTimeout:tag:"> - receiveWithTimeout:tag:</option>
-
- <option value="//api/name/runLoopModes"> - runLoopModes</option>
-
- <option value="//api/name/sendData:toAddress:withTimeout:tag:"> - sendData:toAddress:withTimeout:tag:</option>
-
- <option value="//api/name/sendData:toHost:port:withTimeout:tag:"> - sendData:toHost:port:withTimeout:tag:</option>
-
- <option value="//api/name/sendData:withTimeout:tag:"> - sendData:withTimeout:tag:</option>
-
- <option value="//api/name/setDelegate:"> - setDelegate:</option>
-
- <option value="//api/name/setMaxReceiveBufferSize:"> - setMaxReceiveBufferSize:</option>
-
- <option value="//api/name/setRunLoopModes:"> - setRunLoopModes:</option>
-
- <option value="//api/name/setUserData:"> - setUserData:</option>
-
- <option value="//api/name/userData"> - userData</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/bindToAddress:port:error:">bindToAddress:port:error:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/bindToPort:error:">bindToPort:error:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/close">close</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/closeAfterReceiving">closeAfterReceiving</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/closeAfterSending">closeAfterSending</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/closeAfterSendingAndReceiving">closeAfterSendingAndReceiving</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectToAddress:error:">connectToAddress:error:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectToHost:onPort:error:">connectToHost:onPort:error:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectedHost">connectedHost</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/connectedPort">connectedPort</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/delegate">delegate</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/enableBroadcast:error:">enableBroadcast:error:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/init">init</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initIPv4">initIPv4</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initIPv6">initIPv6</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithDelegate:">initWithDelegate:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithDelegate:userData:">initWithDelegate:userData:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isClosed">isClosed</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isConnected">isConnected</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isIPv4">isIPv4</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/isIPv6">isIPv6</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/joinMulticastGroup:error:">joinMulticastGroup:error:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/joinMulticastGroup:withAddress:error:">joinMulticastGroup:withAddress:error:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/localHost">localHost</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/localPort">localPort</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/maxReceiveBufferSize">maxReceiveBufferSize</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/maximumTransmissionUnit">maximumTransmissionUnit</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/moveToRunLoop:">moveToRunLoop:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/receiveWithTimeout:tag:">receiveWithTimeout:tag:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/runLoopModes">runLoopModes</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sendData:toAddress:withTimeout:tag:">sendData:toAddress:withTimeout:tag:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sendData:toHost:port:withTimeout:tag:">sendData:toHost:port:withTimeout:tag:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sendData:withTimeout:tag:">sendData:withTimeout:tag:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setDelegate:">setDelegate:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setMaxReceiveBufferSize:">setMaxReceiveBufferSize:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setRunLoopModes:">setRunLoopModes:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setUserData:">setUserData:</a></span></li>
-
- <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/userData">userData</a></span></li>
-
- </ul></li>
- </ul>
- </nav>
- <article>
- <div id="contents" class="isShowingTOC" role="main">
- <a title="AsyncUdpSocket Class 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">AsyncUdpSocket Class Reference</h1>
- </div>
- </div>
- <div id="container">
-
- <div class="section section-specification"><table cellspacing="0"><tbody>
- <tr>
- <td class="specification-title">Inherits from</td>
- <td class="specification-value">NSObject</td>
- </tr><tr>
- <td class="specification-title">Declared in</td>
- <td class="specification-value">AsyncUdpSocket.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/init">– init</a></code>
- <span class="tooltip"><p>Creates new instances of AsyncUdpSocket.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/initWithDelegate:">– initWithDelegate:</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/initWithDelegate:userData:">– initWithDelegate:userData:</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/initIPv4">– initIPv4</a></code>
- <span class="tooltip"><p>Creates new instances of AsyncUdpSocket that support only IPv4 or IPv6.<br/>
- The other <a href="#//api/name/init">init</a> methods will support both, unless specifically binded or connected to one protocol.<br/>
- If you know you’ll only be using one protocol, these <a href="#//api/name/init">init</a> methods may be a bit more efficient.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/initIPv6">– initIPv6</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/delegate">– delegate</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/setDelegate:">– setDelegate:</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/userData">– userData</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/setUserData:">– setUserData:</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/localHost">– localHost</a></code>
- <span class="tooltip"><p>Returns the local address info for the socket.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/localPort">– localPort</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/connectedHost">– connectedHost</a></code>
- <span class="tooltip"><p>Returns the remote address info for the socket.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/connectedPort">– connectedPort</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/isConnected">– isConnected</a></code>
- <span class="tooltip"><p>Returns whether or not this socket has been connected to a single host.<br/>
- By design, UDP is a connectionless protocol, and connecting is not needed.<br/>
- If connected, the socket will only be able to send/receive data to/from the connected host.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/isClosed">– isClosed</a></code>
- <span class="tooltip"><p>Returns whether or not this socket has been closed.<br/>
- The only way a socket can be closed is if you explicitly call one of the <a href="#//api/name/close">close</a> methods.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/isIPv4">– isIPv4</a></code>
- <span class="tooltip"><p>Returns whether or not this socket supports IPv4.<br/>
- By default this will be true, unless the socket is specifically initialized as IPv6 only,<br/>
- or is binded or connected to an IPv6 address.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/isIPv6">– isIPv6</a></code>
- <span class="tooltip"><p>Returns whether or not this socket supports IPv6.<br/>
- By default this will be true, unless the socket is specifically initialized as IPv4 only,<br/>
- or is binded or connected to an IPv4 address.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/maximumTransmissionUnit">– maximumTransmissionUnit</a></code>
- <span class="tooltip"><p>Returns the mtu of the socket.<br/>
- If unknown, returns zero.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/bindToPort:error:">– bindToPort:error:</a></code>
- <span class="tooltip"><p>Binds the UDP socket to the given port and optional address.<br/>
- Binding should be done for server sockets that receive data prior to sending it.<br/>
- Client sockets can skip binding,<br/>
- as the OS will automatically assign the socket an available port when it starts sending data.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/bindToAddress:port:error:">– bindToAddress:port:error:</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/connectToHost:onPort:error:">– connectToHost:onPort:error:</a></code>
- <span class="tooltip"><p>Connects the UDP socket to the given host and port.<br/>
- By design, UDP is a connectionless protocol, and connecting is not needed.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/connectToAddress:error:">– connectToAddress:error:</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/joinMulticastGroup:error:">– joinMulticastGroup:error:</a></code>
- <span class="tooltip"><p>Join multicast group</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/joinMulticastGroup:withAddress:error:">– joinMulticastGroup:withAddress:error:</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/enableBroadcast:error:">– enableBroadcast:error:</a></code>
- <span class="tooltip"><p>By default, the underlying socket in the OS will not allow you to send broadcast messages.<br/>
- In order to send broadcast messages, you need to enable this functionality in the socket.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/sendData:withTimeout:tag:">– sendData:withTimeout:tag:</a></code>
- <span class="tooltip"><p>Asynchronously sends the given data, with the given timeout and tag.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/sendData:toHost:port:withTimeout:tag:">– sendData:toHost:port:withTimeout:tag:</a></code>
- <span class="tooltip"><p>Asynchronously sends the given data, with the given timeout and tag, to the given host and port.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/sendData:toAddress:withTimeout:tag:">– sendData:toAddress:withTimeout:tag:</a></code>
- <span class="tooltip"><p>Asynchronously sends the given data, with the given timeout and tag, to the given address.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/receiveWithTimeout:tag:">– receiveWithTimeout:tag:</a></code>
- <span class="tooltip"><p>Asynchronously receives a single datagram packet.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/close">– close</a></code>
- <span class="tooltip"><p>Closes the socket immediately. Any pending send or receive operations are dropped.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/closeAfterSending">– closeAfterSending</a></code>
- <span class="tooltip"><p>Closes after all pending send operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.<br/>
- The socket will <a href="#//api/name/close">close</a> even if there are still pending receive operations.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/closeAfterReceiving">– closeAfterReceiving</a></code>
- <span class="tooltip"><p>Closes after all pending receive operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.<br/>
- The socket will <a href="#//api/name/close">close</a> even if there are still pending send operations.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/closeAfterSendingAndReceiving">– closeAfterSendingAndReceiving</a></code>
- <span class="tooltip"><p>Closes after all pending send and receive operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/maxReceiveBufferSize">– maxReceiveBufferSize</a></code>
- <span class="tooltip"><p>Gets/Sets the maximum size of the buffer that will be allocated for receive operations.<br/>
- The default size is 9216 bytes.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/setMaxReceiveBufferSize:">– setMaxReceiveBufferSize:</a></code>
-
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/moveToRunLoop:">– moveToRunLoop:</a></code>
- <span class="tooltip"><p>When you create an AsyncUdpSocket, it is added to the runloop of the current thread.<br/>
- So it is easiest to simply create the socket on the thread you intend to use it.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/setRunLoopModes:">– setRunLoopModes:</a></code>
- <span class="tooltip"><p>Allows you to configure which run loop modes the socket uses.<br/>
- The default set of run loop modes is NSDefaultRunLoopMode.</p></span>
- </span>
-
-
- </li><li>
- <span class="tooltip">
- <code><a href="#//api/name/runLoopModes">– runLoopModes</a></code>
- <span class="tooltip"><p>Returns the current run loop modes the <a href="../Classes/AsyncSocket.html">AsyncSocket</a> instance is operating in.<br/>
- The default set of run loop modes is NSDefaultRunLoopMode.</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/bindToAddress:port:error:" title="bindToAddress:port:error:"></a>
- <h3 class="subsubtitle method-title">bindToAddress:port:error:</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)bindToAddress:(NSString *)<em>localAddr</em> port:(UInt16)<em>port</em> error:(NSError **)<em>errPtr</em></code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/bindToPort:error:" title="bindToPort:error:"></a>
- <h3 class="subsubtitle method-title">bindToPort:error:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Binds the UDP socket to the given port and optional address.<br/>
- Binding should be done for server sockets that receive data prior to sending it.<br/>
- Client sockets can skip binding,<br/>
- as the OS will automatically assign the socket an available port when it starts sending data.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)bindToPort:(UInt16)<em>port</em> error:(NSError **)<em>errPtr</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Binds the UDP socket to the given port and optional address.<br/>
- Binding should be done for server sockets that receive data prior to sending it.<br/>
- Client sockets can skip binding,<br/>
- as the OS will automatically assign the socket an available port when it starts sending data.</p>
- <p>You cannot bind a socket after its been connected.<br/>
- You can only bind a socket once.<br/>
- You can still connect a socket (if desired) after binding.</p>
- <p>On success, returns YES.<br/>
- Otherwise returns NO, and sets errPtr. If you don’t care about the error, you can pass nil for errPtr.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/close" title="close"></a>
- <h3 class="subsubtitle method-title">close</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Closes the socket immediately. Any pending send or receive operations are dropped.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)close</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Closes the socket immediately. Any pending send or receive operations are dropped.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/closeAfterReceiving" title="closeAfterReceiving"></a>
- <h3 class="subsubtitle method-title">closeAfterReceiving</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Closes after all pending receive operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.<br/>
- The socket will <a href="#//api/name/close">close</a> even if there are still pending send operations.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)closeAfterReceiving</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Closes after all pending receive operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.<br/>
- The socket will <a href="#//api/name/close">close</a> even if there are still pending send operations.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/closeAfterSending" title="closeAfterSending"></a>
- <h3 class="subsubtitle method-title">closeAfterSending</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Closes after all pending send operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.<br/>
- The socket will <a href="#//api/name/close">close</a> even if there are still pending receive operations.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)closeAfterSending</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Closes after all pending send operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.<br/>
- The socket will <a href="#//api/name/close">close</a> even if there are still pending receive operations.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/closeAfterSendingAndReceiving" title="closeAfterSendingAndReceiving"></a>
- <h3 class="subsubtitle method-title">closeAfterSendingAndReceiving</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Closes after all pending send and receive operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)closeAfterSendingAndReceiving</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Closes after all pending send and receive operations have completed.<br/>
- After calling this, the sendData: and receive: methods will do nothing.<br/>
- In other words, you won’t be able to add any more send or receive operations to the queue.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/connectToAddress:error:" title="connectToAddress:error:"></a>
- <h3 class="subsubtitle method-title">connectToAddress:error:</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)connectToAddress:(NSData *)<em>remoteAddr</em> error:(NSError **)<em>errPtr</em></code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/connectToHost:onPort:error:" title="connectToHost:onPort:error:"></a>
- <h3 class="subsubtitle method-title">connectToHost:onPort:error:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Connects the UDP socket to the given host and port.<br/>
- By design, UDP is a connectionless protocol, and connecting is not needed.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)connectToHost:(NSString *)<em>host</em> onPort:(UInt16)<em>port</em> error:(NSError **)<em>errPtr</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Connects the UDP socket to the given host and port.<br/>
- By design, UDP is a connectionless protocol, and connecting is not needed.</p>
- <p>Choosing to connect to a specific host/port has the following effect:<br/>
- - You will only be able to send data to the connected host/port.<br/>
- - You will only be able to receive data from the connected host/port.<br/>
- - You will receive ICMP messages that come from the connected host/port, such as “connection refused”.</p>
- <p>Connecting a UDP socket does not result in any communication on the socket.<br/>
- It simply changes the internal state of the socket.</p>
- <p>You cannot bind a socket after its been connected.<br/>
- You can only connect a socket once.</p>
- <p>On success, returns YES.<br/>
- Otherwise returns NO, and sets errPtr. If you don’t care about the error, you can pass nil for errPtr.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/connectedHost" title="connectedHost"></a>
- <h3 class="subsubtitle method-title">connectedHost</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Returns the remote address info for the socket.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (NSString *)connectedHost</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Returns the remote address info for the socket.</p>
- <p>Note: Since UDP is connectionless by design, connected address info<br/>
- will not be available unless the socket is explicitly connected to a remote host/port</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/connectedPort" title="connectedPort"></a>
- <h3 class="subsubtitle method-title">connectedPort</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (UInt16)connectedPort</code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/delegate" title="delegate"></a>
- <h3 class="subsubtitle method-title">delegate</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (id)delegate</code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/enableBroadcast:error:" title="enableBroadcast:error:"></a>
- <h3 class="subsubtitle method-title">enableBroadcast:error:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>By default, the underlying socket in the OS will not allow you to send broadcast messages.<br/>
- In order to send broadcast messages, you need to enable this functionality in the socket.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)enableBroadcast:(BOOL)<em>flag</em> error:(NSError **)<em>errPtr</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>By default, the underlying socket in the OS will not allow you to send broadcast messages.<br/>
- In order to send broadcast messages, you need to enable this functionality in the socket.</p>
- <p>A broadcast is a UDP message to addresses like “192.168.255.255” or “255.255.255.255” that is<br/>
- delivered to every host on the network.<br/>
- The reason this is generally disabled by default is to prevent<br/>
- accidental broadcast messages from flooding the network.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/init" title="init"></a>
- <h3 class="subsubtitle method-title">init</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Creates new instances of AsyncUdpSocket.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (id)init</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Creates new instances of AsyncUdpSocket.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/initIPv4" title="initIPv4"></a>
- <h3 class="subsubtitle method-title">initIPv4</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Creates new instances of AsyncUdpSocket that support only IPv4 or IPv6.<br/>
- The other <a href="#//api/name/init">init</a> methods will support both, unless specifically binded or connected to one protocol.<br/>
- If you know you’ll only be using one protocol, these <a href="#//api/name/init">init</a> methods may be a bit more efficient.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (id)initIPv4</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Creates new instances of AsyncUdpSocket that support only IPv4 or IPv6.<br/>
- The other <a href="#//api/name/init">init</a> methods will support both, unless specifically binded or connected to one protocol.<br/>
- If you know you’ll only be using one protocol, these <a href="#//api/name/init">init</a> methods may be a bit more efficient.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/initIPv6" title="initIPv6"></a>
- <h3 class="subsubtitle method-title">initIPv6</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (id)initIPv6</code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/initWithDelegate:" title="initWithDelegate:"></a>
- <h3 class="subsubtitle method-title">initWithDelegate:</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (id)initWithDelegate:(id)<em>delegate</em></code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/initWithDelegate:userData:" title="initWithDelegate:userData:"></a>
- <h3 class="subsubtitle method-title">initWithDelegate:userData:</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (id)initWithDelegate:(id)<em>delegate</em> userData:(long)<em>userData</em></code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/isClosed" title="isClosed"></a>
- <h3 class="subsubtitle method-title">isClosed</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Returns whether or not this socket has been closed.<br/>
- The only way a socket can be closed is if you explicitly call one of the <a href="#//api/name/close">close</a> methods.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)isClosed</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Returns whether or not this socket has been closed.<br/>
- The only way a socket can be closed is if you explicitly call one of the <a href="#//api/name/close">close</a> methods.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/isConnected" title="isConnected"></a>
- <h3 class="subsubtitle method-title">isConnected</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Returns whether or not this socket has been connected to a single host.<br/>
- By design, UDP is a connectionless protocol, and connecting is not needed.<br/>
- If connected, the socket will only be able to send/receive data to/from the connected host.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)isConnected</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Returns whether or not this socket has been connected to a single host.<br/>
- By design, UDP is a connectionless protocol, and connecting is not needed.<br/>
- If connected, the socket will only be able to send/receive data to/from the connected host.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/isIPv4" title="isIPv4"></a>
- <h3 class="subsubtitle method-title">isIPv4</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Returns whether or not this socket supports IPv4.<br/>
- By default this will be true, unless the socket is specifically initialized as IPv6 only,<br/>
- or is binded or connected to an IPv6 address.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)isIPv4</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Returns whether or not this socket supports IPv4.<br/>
- By default this will be true, unless the socket is specifically initialized as IPv6 only,<br/>
- or is binded or connected to an IPv6 address.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/isIPv6" title="isIPv6"></a>
- <h3 class="subsubtitle method-title">isIPv6</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Returns whether or not this socket supports IPv6.<br/>
- By default this will be true, unless the socket is specifically initialized as IPv4 only,<br/>
- or is binded or connected to an IPv4 address.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)isIPv6</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Returns whether or not this socket supports IPv6.<br/>
- By default this will be true, unless the socket is specifically initialized as IPv4 only,<br/>
- or is binded or connected to an IPv4 address.</p>
- <p>This method will also return false on platforms that do not support IPv6.<br/>
- Note: The iPhone does not currently support IPv6.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/joinMulticastGroup:error:" title="joinMulticastGroup:error:"></a>
- <h3 class="subsubtitle method-title">joinMulticastGroup:error:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Join multicast group</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)joinMulticastGroup:(NSString *)<em>group</em> error:(NSError **)<em>errPtr</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Join multicast group</p>
- <p>Group should be an IP address (eg @“225.228.0.1”)</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/joinMulticastGroup:withAddress:error:" title="joinMulticastGroup:withAddress:error:"></a>
- <h3 class="subsubtitle method-title">joinMulticastGroup:withAddress:error:</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)joinMulticastGroup:(NSString *)<em>group</em> withAddress:(NSString *)<em>interface</em> error:(NSError **)<em>errPtr</em></code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/localHost" title="localHost"></a>
- <h3 class="subsubtitle method-title">localHost</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Returns the local address info for the socket.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (NSString *)localHost</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Returns the local address info for the socket.</p>
- <p>Note: Address info may not be available until after the socket has been bind'ed,<br/>
- or until after data has been sent.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/localPort" title="localPort"></a>
- <h3 class="subsubtitle method-title">localPort</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (UInt16)localPort</code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/maxReceiveBufferSize" title="maxReceiveBufferSize"></a>
- <h3 class="subsubtitle method-title">maxReceiveBufferSize</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Gets/Sets the maximum size of the buffer that will be allocated for receive operations.<br/>
- The default size is 9216 bytes.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (UInt32)maxReceiveBufferSize</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Gets/Sets the maximum size of the buffer that will be allocated for receive operations.<br/>
- The default size is 9216 bytes.</p>
- <p>The theoretical maximum size of any IPv4 UDP packet is UINT16_MAX = 65535.<br/>
- The theoretical maximum size of any IPv6 UDP packet is UINT32_MAX = 4294967295.</p>
- <p>In practice, however, the size of UDP packets will be much smaller.<br/>
- Indeed most protocols will send and receive packets of only a few bytes,<br/>
- or will set a limit on the size of packets to prevent fragmentation in the IP layer.</p>
- <p>If you set the buffer size too small, the sockets API in the OS will silently discard<br/>
- any extra data, and you will not be notified of the error.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/maximumTransmissionUnit" title="maximumTransmissionUnit"></a>
- <h3 class="subsubtitle method-title">maximumTransmissionUnit</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Returns the mtu of the socket.<br/>
- If unknown, returns zero.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (unsigned int)maximumTransmissionUnit</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Returns the mtu of the socket.<br/>
- If unknown, returns zero.</p>
- <p>Sending data larger than this may result in an error.<br/>
- This is an advanced topic, and one should understand the wide range of mtu’s on networks and the internet.<br/>
- Therefore this method is only for reference and may be of little use in many situations.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/moveToRunLoop:" title="moveToRunLoop:"></a>
- <h3 class="subsubtitle method-title">moveToRunLoop:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>When you create an AsyncUdpSocket, it is added to the runloop of the current thread.<br/>
- So it is easiest to simply create the socket on the thread you intend to use it.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)moveToRunLoop:(NSRunLoop *)<em>runLoop</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>When you create an AsyncUdpSocket, it is added to the runloop of the current thread.<br/>
- So it is easiest to simply create the socket on the thread you intend to use it.</p>
- <p>If, however, you need to move the socket to a separate thread at a later time, this<br/>
- method may be used to accomplish the task.</p>
- <p>This method must be called from the thread/runloop the socket is currently running on.</p>
- <p>Note: After calling this method, all further method calls to this object should be done from the given runloop.<br/>
- Also, all <a href="#//api/name/delegate">delegate</a> calls will be sent on the given runloop.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/receiveWithTimeout:tag:" title="receiveWithTimeout:tag:"></a>
- <h3 class="subsubtitle method-title">receiveWithTimeout:tag:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Asynchronously receives a single datagram packet.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (void)receiveWithTimeout:(NSTimeInterval)<em>timeout</em> tag:(long)<em>tag</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Asynchronously receives a single datagram packet.</p>
- <p>If the receive succeeds, the onUdpSocket:didReceiveData:fromHost:port:tag <a href="#//api/name/delegate">delegate</a> method will be called.<br/>
- Otherwise, a timeout will occur, and the onUdpSocket:didNotReceiveDataWithTag: <a href="#//api/name/delegate">delegate</a> method will be called.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/runLoopModes" title="runLoopModes"></a>
- <h3 class="subsubtitle method-title">runLoopModes</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Returns the current run loop modes the <a href="../Classes/AsyncSocket.html">AsyncSocket</a> instance is operating in.<br/>
- The default set of run loop modes is NSDefaultRunLoopMode.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (NSArray *)runLoopModes</code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Returns the current run loop modes the <a href="../Classes/AsyncSocket.html">AsyncSocket</a> instance is operating in.<br/>
- The default set of run loop modes is NSDefaultRunLoopMode.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/sendData:toAddress:withTimeout:tag:" title="sendData:toAddress:withTimeout:tag:"></a>
- <h3 class="subsubtitle method-title">sendData:toAddress:withTimeout:tag:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Asynchronously sends the given data, with the given timeout and tag, to the given address.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)sendData:(NSData *)<em>data</em> toAddress:(NSData *)<em>remoteAddr</em> withTimeout:(NSTimeInterval)<em>timeout</em> tag:(long)<em>tag</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Asynchronously sends the given data, with the given timeout and tag, to the given address.</p>
- <p>This method cannot be used with a connected socket.</p>
- <p>If data is nil or zero-length, this method does nothing and immediately returns NO.<br/>
- If the socket is connected, this method does nothing and immediately returns NO.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/sendData:toHost:port:withTimeout:tag:" title="sendData:toHost:port:withTimeout:tag:"></a>
- <h3 class="subsubtitle method-title">sendData:toHost:port:withTimeout:tag:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Asynchronously sends the given data, with the given timeout and tag, to the given host and port.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)sendData:(NSData *)<em>data</em> toHost:(NSString *)<em>host</em> port:(UInt16)<em>port</em> withTimeout:(NSTimeInterval)<em>timeout</em> tag:(long)<em>tag</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Asynchronously sends the given data, with the given timeout and tag, to the given host and port.</p>
- <p>This method cannot be used with a connected socket.</p>
- <p>If data is nil or zero-length, this method does nothing and immediately returns NO.<br/>
- If the socket is connected, this method does nothing and immediately returns NO.<br/>
- If unable to resolve host to a valid IPv4 or IPv6 address, this method returns NO.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/sendData:withTimeout:tag:" title="sendData:withTimeout:tag:"></a>
- <h3 class="subsubtitle method-title">sendData:withTimeout:tag:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Asynchronously sends the given data, with the given timeout and tag.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)sendData:(NSData *)<em>data</em> withTimeout:(NSTimeInterval)<em>timeout</em> tag:(long)<em>tag</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Asynchronously sends the given data, with the given timeout and tag.</p>
- <p>This method may only be used with a connected socket.</p>
- <p>If data is nil or zero-length, this method does nothing and immediately returns NO.<br/>
- If the socket is not connected, this method does nothing and immediately returns NO.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/setDelegate:" title="setDelegate:"></a>
- <h3 class="subsubtitle method-title">setDelegate:</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (void)setDelegate:(id)<em>delegate</em></code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/setMaxReceiveBufferSize:" title="setMaxReceiveBufferSize:"></a>
- <h3 class="subsubtitle method-title">setMaxReceiveBufferSize:</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (void)setMaxReceiveBufferSize:(UInt32)<em>max</em></code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/setRunLoopModes:" title="setRunLoopModes:"></a>
- <h3 class="subsubtitle method-title">setRunLoopModes:</h3>
-
-
-
- <div class="method-subsection brief-description">
- <p>Allows you to configure which run loop modes the socket uses.<br/>
- The default set of run loop modes is NSDefaultRunLoopMode.</p>
- </div>
-
-
- <div class="method-subsection method-declaration"><code>- (BOOL)setRunLoopModes:(NSArray *)<em>runLoopModes</em></code></div>
-
-
-
-
-
-
-
-
- <div class="method-subsection discussion-section">
- <h4 class="method-subtitle">Discussion</h4>
- <p>Allows you to configure which run loop modes the socket uses.<br/>
- The default set of run loop modes is NSDefaultRunLoopMode.</p>
- <p>If you’d like your socket to continue operation during other modes, you may want to add modes such as<br/>
- NSModalPanelRunLoopMode or NSEventTrackingRunLoopMode. Or you may simply want to use NSRunLoopCommonModes.</p>
- <p>Note: NSRunLoopCommonModes is defined in 10.5. For previous versions one can use kCFRunLoopCommonModes.</p>
- </div>
-
-
-
-
-
-
-
- <div class="method-subsection declared-in-section">
- <h4 class="method-subtitle">Declared In</h4>
- <code class="declared-in-ref">AsyncUdpSocket.h</code><br />
- </div>
-
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/setUserData:" title="setUserData:"></a>
- <h3 class="subsubtitle method-title">setUserData:</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (void)setUserData:(long)<em>userData</em></code></div>
-
- </div>
-
- <div class="section-method">
- <a name="//api/name/userData" title="userData"></a>
- <h3 class="subsubtitle method-title">userData</h3>
-
-
- <div class="method-subsection method-declaration"><code>- (long)userData</code></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>