UDPDuplex Class Reference

[APE Index] [APE Hierarchy] [Headers]


Unreliable Datagram Peer Associations. More...

#include <socket.h>

Public Members


Detailed Description

UDP duplex connections impliment a bi-directional point-to-point UDP session between two peer hosts. Two UDP sockets are typically used on alternating port addresses to assure that sender and receiver data does not collide or echo back. A UDP Duplex is commonly used for full duplex real-time streaming of UDP data between hosts.


UDPDuplex(InetAddress &bind, short from, short to) [public]

Create a UDP duplex as a pair of UDP simplex objects bound to alternating and interconnected port addresses.

Parameters:
port number to bind reciever.
bind address to bind this socket to.

~UDPDuplex() [public]

Disconnect and remove a UDP Duplex session.

int Connect(InetHostAddress &host) [public]

Associate the duplex with a specified peer host. Both the sender and receiver will be interconnected with the remote host.

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

int Broadcast(BroadcastAddress &subnet) [public]

Associate transmitter and receiver with a subnet for multi-peer subnet media streaming.

Parameters:
subnet address to operate under.
Returns:
0 on success, -1 on error.

int Disconnect(void) [public]

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

int Loopback(void) [public]

Associate the duplex 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.

int Peek(void *addr, size_t len) [public]

Examine next waiting UDP packet in the buffer without actually removing it from the socket head.

Parameters:
length of packet to accept.
address to store packet to examine.
Returns:
number of bytes available.

int Read(void *addr, size_t len) [public]

Read (receive) a UDP packet from the remote host using the simpex receiver.

Parameters:
maximum length of packet to accept.
address to store packet received.
Returns:
number of bytes read, or -1 on error.

int Write(void *addr, size_t len) [public]

Write (send) a UDP packet to the remote host using the simplex sender.

Parameters:
length of packet to send.
address of packet to send.
Returns:
number of bytes sent, or -1 on error.

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