# Poco::Net

# template < std::size_t S = (1472 + sizeof (UDPMsgSizeT)+ SocketAddress::MAX_ADDRESS_LENGTH)>

# class SingleSocketPoller

Library: Net
Package: UDP
Header: Poco/Net/SingleSocketPoller.h

## Description

SingleSocketPoller, as its name indicates, repeatedly polls a single socket for readability; if the socket is readable, the reading action is delegated to the reader.

## Member Summary

Member Functions: address, done, poll, port, stop

## Constructors

### SingleSocketPoller

SingleSocketPoller(
typename UDPHandlerImpl < S >::List & handlers,
const UDPServerParams & serverParams
);

Creates the SingleSocketPoller and binds it to the given address.

### SingleSocketPoller

SingleSocketPoller(
typename UDPHandlerImpl < S >::List & handlers,
const Poco::Net::SocketAddress & sa,
Poco::Timespan timeout = 250000
);

Creates the SingleSocketPoller and binds it to the given address.

## Destructor

### ~SingleSocketPoller

~SingleSocketPoller();

Destroys SingleSocketPoller

## Member Functions

### address

Poco::Net::SocketAddress address() const;

Returns the address of the server.

### done

bool done() const;

Returns true if handler is done.

### poll

void poll();

Poll the socket and read if readable.

### port

Poco::UInt16 port() const;

Returns the port the socket is listening on.

### stop

void stop();

Stops the handler.