<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <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.5 on Thu Oct 4 15:33:02 2001 --> <center> <a class="qindex" href="index.html">Main Page</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="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_h-source.html">socket.h</a>></code> <p> <p>Inheritance diagram for UDPReceive: <p><center><img src="class_udpreceive.gif" usemap="#UDPReceive_map" border="0"></center> <map name="UDPReceive_map"> <area href="class_udpsocket.html" alt="UDPSocket" shape="rect" coords="0,0,83,24"> <area href="class_udpduplex.html" alt="UDPDuplex" shape="rect" coords="0,112,83,136"> </map> <a href="class_udpreceive-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_udpreceive.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><a class="el" href="config_h.html#a17">bool</a> </td><td valign=bottom><a class="el" href="class_udpreceive.html#a1">isInputReady</a> (<a class="el" href="thread_h.html#a1">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_udpreceive.html#b0">UDPReceive</a> (const <a class="el" href="class_inetaddress.html">InetAddress</a> &bind, <a class="el" href="socket_h.html#a2">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_h.html#a60">sockerror_t</a> </td><td valign=bottom><a class="el" href="class_udpreceive.html#b1">Connect</a> (const <a class="el" href="class_inethostaddress.html">InetHostAddress</a> &host, <a class="el" href="socket_h.html#a2">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_h.html#a60">sockerror_t</a> </td><td valign=bottom><a class="el" href="class_udpreceive.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><a class="el" href="config_h.html#a17">bool</a> </td><td valign=bottom><a class="el" href="class_udpreceive.html#b3">isPendingReceive</a> (<a class="el" href="thread_h.html#a1">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_udpreceive.html#b4">endReceiver</a> (void)</td></tr> <tr><td> </td><td><font size=-1><em>End receiver.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="socket_h.html#a1">SOCKET</a> </td><td valign=bottom><a class="el" href="class_udpreceive.html#b5">getReceiver</a> (void)</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="socket_h.html#a60">sockerror_t</a> </td><td valign=bottom><a class="el" href="class_udpreceive.html#b6">setRouting</a> (<a class="el" href="config_h.html#a17">bool</a> 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_udpduplex.html">UDPDuplex</a>. <p> <dl compact><dt> <b>Author(s): </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 nowrap valign="top"><b> UDPReceive::UDPReceive ( </b></td> <td valign="bottom"><b> const <a class="el" href="class_inetaddress.html">InetAddress</a> & <em>bind</em>, </b></td> </tr> <tr> <td></td> <td><b> <a class="el" href="socket_h.html#a2">tpport_t</a> <em>port</em> )<code> [protected]</code> </b></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 nowrap valign="top"><b> <a class="el" href="socket_h.html#a60">sockerror_t</a> UDPReceive::Connect ( </b></td> <td valign="bottom"><b> const <a class="el" href="class_inethostaddress.html">InetHostAddress</a> & <em>host</em>, </b></td> </tr> <tr> <td></td> <td><b> <a class="el" href="socket_h.html#a2">tpport_t</a> <em>port</em> )<code> [protected]</code> </b></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_udpduplex.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 nowrap valign="top"><b> <a class="el" href="socket_h.html#a60">sockerror_t</a> UDPReceive::Disconnect ( </b></td> <td valign="bottom"><b> void )<code> [protected]</code> </b></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_udpduplex.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 nowrap valign="top"><b> int UDPReceive::Receive ( </b></td> <td valign="bottom"><b> void * <em>buf</em>, </b></td> </tr> <tr> <td></td> <td><b> size_t <em>len</em> )<code> [inline]</code> </b></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 nowrap valign="top"><b> void UDPReceive::endReceiver ( </b></td> <td valign="bottom"><b> void )<code> [inline, protected]</code> </b></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 nowrap valign="top"><b> <a class="el" href="socket_h.html#a1">SOCKET</a> UDPReceive::getReceiver ( </b></td> <td valign="bottom"><b> void )<code> [inline, protected]</code> </b></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 nowrap valign="top"><b> <a class="el" href="config_h.html#a17">bool</a> UDPReceive::isInputReady ( </b></td> <td valign="bottom"><b> <a class="el" href="thread_h.html#a1">timeout_t</a> <em>timeout</em> = TIMEOUT_INF )<code> [inline]</code> </b></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 nowrap valign="top"><b> <a class="el" href="config_h.html#a17">bool</a> UDPReceive::isPendingReceive ( </b></td> <td valign="bottom"><b> <a class="el" href="thread_h.html#a1">timeout_t</a> <em>timeout</em> )<code> [inline, protected]</code> </b></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 nowrap valign="top"><b> <a class="el" href="socket_h.html#a60">sockerror_t</a> UDPReceive::setRouting ( </b></td> <td valign="bottom"><b> <a class="el" href="config_h.html#a17">bool</a> <em>enable</em> )<code> [inline, protected]</code> </b></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_h-source.html">socket.h</a></ul> <hr><address><small>Generated at Thu Oct 4 15:33:02 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.5 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2001</small></address> </body> </html>