---
name: "UDPBroadcast"
section: "3cc"
platform: "linux"
package: "libcommoncpp2-dev"
version: "1.0.13-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/UDPBroadcast"
---

# UDPBroadcast(3cc)

Representing a UDP socket used for subnet broadcasts, this class provides an alternate binding and setPeer() capability for UDP sockets. Unreliable Datagram for subnet broadcasts.

## NAME

UDPBroadcast - Representing a UDP socket used for subnet broadcasts, this class provides an alternate binding and **setPeer()** capability for UDP sockets. Unreliable Datagram for subnet broadcasts.

## SYNOPSIS

`#include <socket.h>`

Inherits **UDPSocket**.

### Public Methods

**UDPBroadcast** (const **InetAddress** &ia, **tpport\_t** port)\
 *Create and bind a subnet broadcast socket.* void **setPeer** (const **BroadcastAddress** &subnet, **tpport\_t** port)\
 *Set peer by subnet rather than specific host.*

## DETAILED DESCRIPTION

Representing a UDP socket used for subnet broadcasts, this class provides an alternate binding and **setPeer()** capability for UDP sockets. Unreliable Datagram for subnet broadcasts.

**Author:**  David Sugar \<dyfet@ostel.com\>

## CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

### UDPBroadcast::UDPBroadcast (const InetAddress & ia, tpport\_t port)

Create and bind a subnet broadcast socket.

**Parameters:**

- *ia*

  *address to bind socket under locally.*

- *port*

  *to bind socket under locally.*

## MEMBER FUNCTION DOCUMENTATION

### void UDPBroadcast::setPeer (const BroadcastAddress & subnet, tpport\_t port)

*Set peer by subnet rather than specific host.*

**Parameters:**

- *subnet*

  *of peer hosts to send to.*

- *port*

  *number to use.*

## AUTHOR

*Generated automatically by Doxygen for CommonC++ from the source code.*
