File Information
Library: UPnP/SSDP
Package: HTTPMU
Header: Poco/UPnP/SSDP/HTTPMUMessageHandler.h
Description
The abstract base class for message handlers created by HTTPMUServer.
Derived classes must override the handleRequest() and handleResponse() methods. Furthermore, a HTTPMUMessageHandlerFactory must be provided.
Note that HTTPMU does not support request-reply messages in the same way as HTTP. All HTTPMU messages are one-way. The correlation between requests and replies must be implemented by an application specific mechanism. If a message handler wants to send a response message to a request, it has to do this by using a HTTPMUClient object.
In order to avoid delays when processing HTTPMU messages in the HTTPMUServer, the handleRequest() and handleResponse() methods should complete as soon as possible. Processing of incoming messages blocks while the message handler is handling a message.
Member Summary
Member Functions: handleRequest, handleResponse
Types
Ptr
typedef Poco::SharedPtr < HTTPMUMessageHandler > Ptr;
Constructors
HTTPMUMessageHandler
Creates a HTTPMUMessageHandler.
Destructor
~HTTPMUMessageHandler
virtual ~HTTPMUMessageHandler();
Destroys the HTTPMUMessageHandler.
Member Functions
handleRequest
virtual void handleRequest(
const Poco::Net::HTTPRequest & request,
const Poco::Net::SocketAddress & senderAddress,
std::istream & requestStream
) = 0;
Handles the given request message.
The IP address and port number of the sender is given in senderAddress.
The request body of the message (if present) can be read from requestStream.
handleResponse
virtual void handleResponse(
const Poco::Net::HTTPResponse & response,
const Poco::Net::SocketAddress & senderAddress,
std::istream & responseStream
) = 0;
Handles the given response message.
The IP address and port number of the sender is given in senderAddress.
The response body of the message (if present) can be read from responseStream.