<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>UDPReceive class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Generated by Doxygen 1.2.10 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> <hr><h1>UDPReceive Class Reference</h1>Representing half of a two-way UDP connection, the UDP receiver can receive data from another peer host or subnet. Unreliable Datagram Peer Associations. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="socket_8h-source.html">socket.h</a>></code> <p> <p>Inheritance diagram for UDPReceive:: <p><center><img src="class_u_d_p_receive.gif" usemap="#UDPReceive_map" border="0"></center> <map name="UDPReceive_map"> <area href="class_u_d_p_socket.html" alt="UDPSocket" shape="rect" coords="0,0,83,24"> <area href="class_u_d_p_duplex.html" alt="UDPDuplex" shape="rect" coords="0,112,83,136"> </map> <a href="class_u_d_p_receive-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#a0">Receive</a> (void *buf, size_t len)</td></tr> <tr><td> </td><td><font size=-1><em>Receive a data packet from the connected peer host.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#a1">isInputReady</a> (<a class="el" href="thread_8h.html#a10">timeout_t</a> timeout=TIMEOUT_INF)</td></tr> <tr><td> </td><td><font size=-1><em>See if input queue has data packets available.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Protected Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#b0">UDPReceive</a> (const <a class="el" href="class_inet_address.html">InetAddress</a> &bind, <a class="el" href="socket_8h.html#a7">tpport_t</a> port)</td></tr> <tr><td> </td><td><font size=-1><em>Create a UDP receiver, bind it to a specific interface and port address so that other UDP sockets on remote machines (or the same host) may find and send UDP messages to it, and associate it with a given port on a peer host.</em> <a href="#b0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="socket_8h.html#a64">sockerror_t</a> </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#b1">Connect</a> (const <a class="el" href="class_inet_host_address.html">InetHostAddress</a> &host, <a class="el" href="socket_8h.html#a7">tpport_t</a> port)</td></tr> <tr><td> </td><td><font size=-1><em>Associate this socket with a specified peer host.</em> <a href="#b1">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="socket_8h.html#a64">sockerror_t</a> </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#b2">Disconnect</a> (void)</td></tr> <tr><td> </td><td><font size=-1><em>Disassociate this socket from any host connection.</em> <a href="#b2">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#b3">isPendingReceive</a> (<a class="el" href="thread_8h.html#a10">timeout_t</a> timeout)</td></tr> <tr><td> </td><td><font size=-1><em>Check for pending data.</em> <a href="#b3">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#b4">endReceiver</a> (void)</td></tr> <tr><td> </td><td><font size=-1><em>End receiver.</em> <a href="#b4">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="socket_8h.html#a2">SOCKET</a> </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#b5">getReceiver</a> (void)</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="socket_8h.html#a64">sockerror_t</a> </td><td valign=bottom><a class="el" href="class_u_d_p_receive.html#b6">setRouting</a> (bool enable)</td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Representing half of a two-way UDP connection, the UDP receiver can receive data from another peer host or subnet. Unreliable Datagram Peer Associations. <p> This class is used exclusivily to derive the <a class="el" href="class_u_d_p_duplex.html">UDPDuplex</a>. <p> <dl compact><dt><b> Author: </b><dd> David Sugar <<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>> </dl> <p> <hr><h2>Constructor & Destructor Documentation</h2> <a name="b0" doxytag="UDPReceive::UDPReceive"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> UDPReceive::UDPReceive </td> <td class="md">( </td> <td class="md">const <a class="el" href="class_inet_address.html">InetAddress</a> &</td> <td class="mdname"> <em>bind</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md"><a class="el" href="socket_8h.html#a7">tpport_t</a></td> <td class="mdname"> <em>port</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Create a UDP receiver, bind it to a specific interface and port address so that other UDP sockets on remote machines (or the same host) may find and send UDP messages to it, and associate it with a given port on a peer host. <p> On failure to bind, an exception is thrown.<dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>bind </em> </td><td> address to bind this socket to. </td></tr> <tr><td valign=top><em>port </em> </td><td> number to bind this socket to. </td></tr> <tr><td valign=top><em>port </em> </td><td> number on peer host to associate with. </td></tr> </table> </dl> </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="b1" doxytag="UDPReceive::Connect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="socket_8h.html#a64">sockerror_t</a> UDPReceive::Connect </td> <td class="md">( </td> <td class="md">const <a class="el" href="class_inet_host_address.html">InetHostAddress</a> &</td> <td class="mdname"> <em>host</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md"><a class="el" href="socket_8h.html#a7">tpport_t</a></td> <td class="mdname"> <em>port</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Associate this socket with a specified peer host. <p> The port number from the constructor will be used. All UDP packets will be sent received from the specified host. <p> <dl compact><dt><b> Returns: </b><dd> 0 on success, -1 on error. </dl><dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>host </em> </td><td> address to connect socket to. </td></tr> </table> </dl> <p> Reimplemented in <a class="el" href="class_u_d_p_duplex.html#a1">UDPDuplex</a>. </td> </tr> </table> <a name="b2" doxytag="UDPReceive::Disconnect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="socket_8h.html#a64">sockerror_t</a> UDPReceive::Disconnect </td> <td class="md">( </td> <td class="md">void</td> <td class="mdname1"> </td> <td class="md">) </td> <td class="md"><code> [protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Disassociate this socket from any host connection. <p> No data should be read or written until a connection is established. <p> Reimplemented in <a class="el" href="class_u_d_p_duplex.html#a2">UDPDuplex</a>. </td> </tr> </table> <a name="a0" doxytag="UDPReceive::Receive"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int UDPReceive::Receive </td> <td class="md">( </td> <td class="md">void *</td> <td class="mdname"> <em>buf</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md">size_t</td> <td class="mdname"> <em>len</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Receive a data packet from the connected peer host. <p> <dl compact><dt><b> Returns: </b><dd> num of bytes actually received. </dl><dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>addr </em> </td><td> of data receive buffer. </td></tr> <tr><td valign=top><em>size </em> </td><td> of data receive buffer. </td></tr> </table> </dl> </td> </tr> </table> <a name="b4" doxytag="UDPReceive::endReceiver"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void UDPReceive::endReceiver </td> <td class="md">( </td> <td class="md">void</td> <td class="mdname1"> </td> <td class="md">) </td> <td class="md"><code> [inline, protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> End receiver. <p> </td> </tr> </table> <a name="b5" doxytag="UDPReceive::getReceiver"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="socket_8h.html#a2">SOCKET</a> UDPReceive::getReceiver </td> <td class="md">( </td> <td class="md">void</td> <td class="mdname1"> </td> <td class="md">) </td> <td class="md"><code> [inline, protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a1" doxytag="UDPReceive::isInputReady"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool UDPReceive::isInputReady </td> <td class="md">( </td> <td class="md"><a class="el" href="thread_8h.html#a10">timeout_t</a></td> <td class="mdname1"> <em>timeout</em> = TIMEOUT_INF </td> <td class="md">) </td> <td class="md"><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> See if input queue has data packets available. <p> <dl compact><dt><b> Returns: </b><dd> true if data packets available. </dl><dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>timeout </em> </td><td> in milliseconds. </td></tr> </table> </dl> </td> </tr> </table> <a name="b3" doxytag="UDPReceive::isPendingReceive"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool UDPReceive::isPendingReceive </td> <td class="md">( </td> <td class="md"><a class="el" href="thread_8h.html#a10">timeout_t</a></td> <td class="mdname1"> <em>timeout</em> </td> <td class="md">) </td> <td class="md"><code> [inline, protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Check for pending data. <p> <dl compact><dt><b> Returns: </b><dd> true if data is waiting. </dl><dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>timeout </em> </td><td> in milliseconds. </td></tr> </table> </dl> </td> </tr> </table> <a name="b6" doxytag="UDPReceive::setRouting"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="socket_8h.html#a64">sockerror_t</a> UDPReceive::setRouting </td> <td class="md">( </td> <td class="md">bool</td> <td class="mdname1"> <em>enable</em> </td> <td class="md">) </td> <td class="md"><code> [inline, protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Reimplemented from <a class="el" href="class_socket.html#b11">Socket</a>. </td> </tr> </table> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="socket_8h-source.html">socket.h</a></ul> <hr><address><small>Generated at Tue Nov 20 13:28:51 2001 for CommonC++ by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.gif" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.10 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2001</small></address> </body> </html>