# Poco::Net

# class DatagramSocketImpl

Library: Net
Package: Sockets
Header: Poco/Net/DatagramSocketImpl.h

## Description

This class implements an UDP socket.

## Inheritance

Direct Base Classes: SocketImpl

All Base Classes: SocketImpl, Poco::RefCountedObject

## Member Summary

Member Functions: init

Inherited Functions: acceptConnection, address, available, bind, close, connect, connectNB, duplicate, error, getBlocking, getBroadcast, getKeepAlive, getLinger, getNoDelay, getOOBInline, getOption, getRawOption, getReceiveBufferSize, getReceiveTimeout, getReuseAddress, getReusePort, getSendBufferSize, getSendTimeout, init, initSocket, initialized, ioctl, lastError, listen, peerAddress, poll, receiveBytes, receiveFrom, referenceCount, release, reset, sendBytes, sendTo, sendUrgent, setBlocking, setBroadcast, setKeepAlive, setLinger, setNoDelay, setOOBInline, setOption, setRawOption, setReceiveBufferSize, setReceiveTimeout, setReuseAddress, setReusePort, setSendBufferSize, setSendTimeout, shutdown, shutdownReceive, shutdownSend, socketError, sockfd

## Constructors

### DatagramSocketImpl

DatagramSocketImpl();

Creates a StreamSocketImpl.

If the system supports IPv6, the socket will be an IPv6 socket. Otherwise, it will be an IPv4 socket.

### DatagramSocketImpl

explicit DatagramSocketImpl(
IPAddress::Family family
);

Creates an unconnected datagram socket.

The socket will be created for the given address family.

### DatagramSocketImpl

DatagramSocketImpl(
int sockfd
);

Creates a StreamSocketImpl using the given native socket.

## Destructor

### ~DatagramSocketImpl

~DatagramSocketImpl();

## Member Functions

### init

void init(
int af
);

See also: Poco::Net::SocketImpl::init()