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 inline

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

Creates the SingleSocketPoller and binds it to the given address.

SingleSocketPoller inline

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 inline

~SingleSocketPoller();

Member Functions

address inline

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

Returns the address of the server.

done inline

bool done() const;

Returns true if handler is done.

poll inline

void poll();

Poll the socket and read if readable.

port inline

Poco::UInt16 port() const;

Returns the port the socket is listening on.

stop inline

void stop();

Stops the handler.