UDPSimplex Class Reference

[APE Index] [APE Hierarchy] [Headers]


Unreliable Datagram Peer Associations. More...

#include <socket.h>

Inherits: Socket

Public Members


Detailed Description

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.


UDPSimplex(InetAddress &bind, short port, short peer = 0) [public]

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.

Parameters:
port number on peer host to associate with.
bind address to bind this socket to.

int Connect(InetHostAddress &host) [public]

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.

Parameters:
host address to connect socket to.
Returns:
0 on success, -1 on error.

int Broadcast(BroadcastAddress &subnet) [public]

Associate this socket with a subnet of peer hosts for subnet broadcasting. The server must be able to assert broadcast permission for the socket.

Parameters:
subnet address to broadcast into.
Returns:
0 on success, -1 on error.

int Disconnect(void) [public]

Disassociate this socket from any host connection. No data should be read or written until a connection is established.

int Loopback(void) [public]

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.


  • Author: David Sugar <dyfet@ostel.com>.
  • Documentation generated by dyfet@home.sys on Thu Dec 16 09:54:26 EST 1999
Kdoc