1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
<HTML><HEAD><TITLE>UDPSimplex Class</TITLE></HEAD>
<BODY bgcolor="#ffffff">
<H1>UDPSimplex Class Reference</H1>
<p>
[<A HREF="index.html">APE Index</A>] [<A HREF="hier.html">APE Hierarchy</A>]
[<A HREF="header-list.html">Headers</A>]
</p>
<HR>
<P>Unreliable Datagram Peer Associations. <a href="#short">More...</a></P>
<P>
<code>
#include <<a href="socket-h.html">socket.h</a>>
</code>
</P>
<P>
Inherits: <a href="Socket.html">Socket</a>
<P>
<H2>Public Members</H2>
<UL>
<LI> <b><a href="#ref0">UDPSimplex</a></b> (InetAddress &bind, short port, short peer = 0)
</LI>
<LI>int <b><a href="#ref1">Connect</a></b> (InetHostAddress &host)
</LI>
<LI>int <b><a href="#ref2">Broadcast</a></b> (BroadcastAddress &subnet)
</LI>
<LI>int <b><a href="#ref3">Disconnect</a></b> (void)
</LI>
<LI>int <b><a href="#ref4">Loopback</a></b> (void)
</LI>
</UL>
<HR>
<H2><a name="short">Detailed Description</a></H2>
<P>
UDP simplex connections are used to impliment point-to-point UDP
sessions and multi-point lan broadcasts between peer hosts under a
single socket. Alternating port addresses are commonly used so that
the transmitter does have to block while waiting on the receiver.
DP Simplex connections can be used to create uni-directional realtime
media sessions between hosts.
</P><HR>
<H3><b> <a name="ref0"></a><a name="UDPSimplex">UDPSimplex</a>(<a href="InetAddress.html">InetAddress</a> &bind, short port, short peer = 0) </b><code>[public]</code></H3>
<p>Create a UDP simplex, 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.
On failure to bind, an exception is thrown.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
port</td><td align="left" valign="top">
number on peer host to associate with.</td></tr>
<tr><td align="left" valign="top">
bind</td><td align="left" valign="top">
address to bind this socket to.</td></tr>
</table>
</dl>
<H3><b>int <a name="ref1"></a><a name="Connect">Connect</a>(<a href="InetHostAddress.html">InetHostAddress</a> &host) </b><code>[public]</code></H3>
<p>Associate this socket with a specified peer host. The port
number from the constructor will be used. All UDP packets
will be sent to and received from the specified host.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
host</td><td align="left" valign="top">
address to connect socket to.</td></tr>
</table>
</dl>
<dl><dt><b>Returns</b>:<dd>
0 on success, -1 on error.</dl>
<H3><b>int <a name="ref2"></a><a name="Broadcast">Broadcast</a>(<a href="BroadcastAddress.html">BroadcastAddress</a> &subnet) </b><code>[public]</code></H3>
<p>Associate this socket with a subnet of peer hosts for
subnet broadcasting. The server must be able to assert
broadcast permission for the socket.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
subnet</td><td align="left" valign="top">
address to broadcast into.</td></tr>
</table>
</dl>
<dl><dt><b>Returns</b>:<dd>
0 on success, -1 on error.</dl>
<H3><b>int <a name="ref3"></a><a name="Disconnect">Disconnect</a>(void) </b><code>[public]</code></H3>
<p>Disassociate this socket from any host connection. No data
should be read or written until a connection is established.
</p>
<H3><b>int <a name="ref4"></a><a name="Loopback">Loopback</a>(void) </b><code>[public]</code></H3>
<p>Associate the socket with itself only. This can be used as
a "disconnect" on systems which do not define AF_UNSPEC. This
also means any data sent by the socket will be received by
itself.
</p>
<HR>
<TABLE WIDTH="100%"><TR><TD ALIGN="left" VALIGN="top">
<UL><LI><I>Author</I>: David Sugar <dyfet@ostel.com>. </LI>
<LI>Documentation generated by dyfet@home.sys on Thu Dec 16 09:54:26 EST 1999
</LI>
</UL></TD><TD ALIGN="RIGHT" VALIGN="TOP">
<b>K</b><i>doc</i>
</TD>
</TR></TABLE></BODY></HTML>
|