Poco::UPnP::SSDP

class HTTPMUServer

File Information

Library: UPnP/SSDP
Package: HTTPMU
Header: Poco/UPnP/SSDP/HTTPMUServer.h

Description

This class implements a simple server for the HTTPMU (HTTP over Multicast/UDP) protocol, as used by the UPnP Simple Service Discovery Protocol (SSDP).

The specification for HTTPMU can be found in the (expired) Internet Draft "Multicast and Unicast UDP HTTP Messages" <http://tools.ietf.org/id/draft-goland-http-udp-00.txt>.

Note that a HTTPMUServer may receive both request and response messages.

The server has an internal limit for the maximum accepted message size, defined by MAX_MESSAGE_SIZE. In practice, messages should be much smaller than this limit to avoid packet fragmentation in the network.

The server can listen on multiple Poco::Net::DatagramSocket (or Poco::Net::MulticastSocket) instances simultaneously.

Member Summary

Member Functions: handleMessages, start, stop

Enumerations

Anonymous

MIN_MESSAGE_SIZE = 16

MAX_MESSAGE_SIZE = 4096

SELECT_TIMEOUT = 100000

Constructors

HTTPMUServer

HTTPMUServer(
    HTTPMUMessageHandlerFactory::Ptr pFactory,
    const Poco::Net::DatagramSocket & socket
);

Creates a HTTPMUServer, using the given message handler factory and socket. The socket can also be a Poco::Net::MulticastSocket.

HTTPMUServer

HTTPMUServer(
    HTTPMUMessageHandlerFactory::Ptr pFactory,
    const std::vector < Poco::Net::DatagramSocket > & sockets
);

Creates a HTTPMUServer, using the given message handler factory and sockets. The socket can also be a Poco::Net::MulticastSocket.

HTTPMUServer

HTTPMUServer(
    HTTPMUMessageHandlerFactory::Ptr pFactory,
    const Poco::Net::DatagramSocket & socket1,
    const Poco::Net::DatagramSocket & socket2
);

Creates a HTTPMUServer, using the given message handler factory and sockets. The sockets can also be Poco::Net::MulticastSocket instances.

Destructor

~HTTPMUServer

~HTTPMUServer();

Destroys the HTTPMUServer.

Member Functions

start

void start();

Starts the server. A new thread will be created that waits for and processes incoming messages.

stop

void stop();

Stops the server.

No new messages will be accepted. Already received messages will be processed to completion.

Once the server is stopped, it cannot be restarted.

handleMessages protected

void handleMessages();

Securely control IoT edge devices from anywhere   Connect a Device