ofxHTTP
A collection of tools for HTTP.
|
A class representing a Server Sent Event Source with a single client. More...
#include <SSEConnection.h>
Public Member Functions | |
SSEConnection (SSERoute &route) | |
Create a SSEConnection. More... | |
virtual | ~SSEConnection () |
Destroy the SSEConnection. | |
void | handleRequest (ServerEventArgs &evt) override |
Handle the ServerEventArgs. More... | |
void | stop () override |
Interrupt the handleRequest method if possible. | |
bool | send (const IndexedSSEFrame &frame) const |
Queue data to be sent to the client. More... | |
Poco::Net::NameValueCollection | requestHeaders () const |
Poco::Net::SocketAddress | clientAddress () const |
bool | isConnected () const |
std::size_t | sendQueueSize () const |
void | clearSendQueue () |
Clears the send queue. | |
std::size_t | totalBytesSent () const |
Get the total bytes sent to the client. More... | |
Public Member Functions inherited from ofx::HTTP::BaseRouteHandler_< SSERoute > | |
BaseRouteHandler_ (SSERoute &route) | |
Create a BaseRoute. | |
virtual | ~BaseRouteHandler_ () |
Destroy a BaseRoute. | |
void | handleRequest (Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response) override |
SSERoute & | route () |
Get the dispatching route. | |
Public Member Functions inherited from ofx::HTTP::AbstractRouteHandler | |
virtual | ~AbstractRouteHandler () |
Destroy the AbstractRouteHandler instance. | |
Public Member Functions inherited from ofx::HTTP::AbstractHTTPRequestHandler | |
virtual | ~AbstractHTTPRequestHandler () |
Destroy the AbstractHTTPRequestHandler. | |
Public Member Functions inherited from ofx::HTTP::AbstractServerEventRequestHandler | |
virtual | ~AbstractServerEventRequestHandler () |
Destroy the AbstractServerEventRequestHandler. | |
Additional Inherited Members | |
Protected Attributes inherited from ofx::HTTP::BaseRouteHandler_< SSERoute > | |
SSERoute & | _route |
The route. | |
A class representing a Server Sent Event Source with a single client.
Frames can be sent across thread boundaries and are queued for sending during the SSERouteConnection's service loop. All accessors are synchronized and thread-safe.
ofx::HTTP::SSEConnection::SSEConnection | ( | SSERoute & | route | ) |
Create a SSEConnection.
route | A reference to the parent SSERoute. |
Poco::Net::SocketAddress ofx::HTTP::SSEConnection::clientAddress | ( | ) | const |
|
overridevirtual |
Handle the ServerEventArgs.
evt | The server request event. |
Send the client retry interval.
Implements ofx::HTTP::BaseRouteHandler_< SSERoute >.
bool ofx::HTTP::SSEConnection::isConnected | ( | ) | const |
Poco::Net::NameValueCollection ofx::HTTP::SSEConnection::requestHeaders | ( | ) | const |
bool ofx::HTTP::SSEConnection::send | ( | const IndexedSSEFrame & | frame | ) | const |
Queue data to be sent to the client.
frame | The data to send to the client. |
cache | True if the frame should be cached. |
std::size_t ofx::HTTP::SSEConnection::sendQueueSize | ( | ) | const |
std::size_t ofx::HTTP::SSEConnection::totalBytesSent | ( | ) | const |
Get the total bytes sent to the client.