Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 68d373e54fb21da3730c08bede406633 > files > 445

libCommonC++1.9_3-devel-1.9.4-2mdk.i586.rpm

<!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> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </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 &lt;<a class="el" href="socket_h-source.html">socket.h</a>&gt;</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&nbsp;</td><td valign=bottom><a class="el" href="class_udpreceive.html#a0">Receive</a> (void *buf, size_t len)</td></tr>
<tr><td>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</td><td valign=bottom><a class="el" href="class_udpreceive.html#b0">UDPReceive</a> (const <a class="el" href="class_inetaddress.html">InetAddress</a> &amp;bind, <a class="el" href="socket_h.html#a2">tpport_t</a> port)</td></tr>
<tr><td>&nbsp;</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>&nbsp;</td><td valign=bottom><a class="el" href="class_udpreceive.html#b1">Connect</a> (const <a class="el" href="class_inethostaddress.html">InetHostAddress</a> &amp;host, <a class="el" href="socket_h.html#a2">tpport_t</a> port)</td></tr>
<tr><td>&nbsp;</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>&nbsp;</td><td valign=bottom><a class="el" href="class_udpreceive.html#b2">Disconnect</a> (void)</td></tr>
<tr><td>&nbsp;</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>&nbsp;</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>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="class_udpreceive.html#b4">endReceiver</a> (void)</td></tr>
<tr><td>&nbsp;</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>&nbsp;</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>&nbsp;</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 &lt;<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>&gt; </dl>
<p>
<hr><h2>Constructor &amp; 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> &amp; <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>&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</td><td>
 address to bind this socket to. </td></tr>
<tr><td valign=top><em>port</em>
&nbsp;</td><td>
 number to bind this socket to. </td></tr>
<tr><td valign=top><em>port</em>
&nbsp;</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> &amp; <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>&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</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&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>&nbsp;)<code> [inline]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</td><td>
 of data receive buffer. </td></tr>
<tr><td valign=top><em>size</em>
&nbsp;</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&nbsp;)<code> [inline, protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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&nbsp;)<code> [inline, protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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&nbsp;)<code> [inline]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</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>&nbsp;)<code> [inline, protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>
&nbsp;</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>&nbsp;)<code> [inline, protected]</code>
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>