Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
HttpAsynchReq Struct Reference

Detailed Description

Asynchronously receive data in a resource such as HttpDir or HttpPage.


An instance of the HttpAsynchReq class can be used as a method to receive any kind of data from a client as long as the client does not send the data as a multipart/form-data. A resource receiving multipart/form-data must use the MultipartUpload class.

You typically create an instance of this class in a resource when receiving a request. You can optionally keep instances of this class in a pool. The object is started by calling method start.

HttpAsynchReq is an abstract base class; thus, you must inherit and implement the socket event method. See constructor for how to install the event function.

The detached socket object is installed directly into the SoDisp object, and any socket event is directed to this object. The callback installed by the constructor receives body data and terminal notifications; see HttpAsynchReq_OnData.

See also
HttpRecData

#include <HttpAsynchReq.h>

Inheritance diagram for HttpAsynchReq:

Public Member Functions

 HttpAsynchReq ()
 Uninitialized storage; initialize before use or destruction. More...
 
 HttpAsynchReq (HttpServer *server, HttpAsynchReq_OnData data)
 Create an instance of HttpAsynchReq. More...
 
 ~HttpAsynchReq ()
 Stop dispatcher reception and destroy the owned connection. More...
 
SBaFileSize getPacketSizeLeft ()
 Inspect receive progress after successful start. More...
 
void * getBuffer ()
 Returns a pointer to the internal buffer where the received data is stored. More...
 
SBaFileSize getBufferSize ()
 
bool isChunkEncoding ()
 
int start (HttpRequest *req, void *buffer, S32 bufferSize)
 Take over the request connection and start asynchronous reception. More...
 
void stop ()
 Remove active dispatcher reception, mark an active connection terminated, and clear receive-buffer state. More...
 
HttpConnection * getCon (HttpAsynchReq *o)
 Stop dispatcher reception and obtain the connection for handoff. More...
 

Static Public Member Functions

static SBaFileSize calcPacketSize (HttpRequest *req)
 Inspect the request's body framing without consuming it. More...
 

Constructor & Destructor Documentation

◆ HttpAsynchReq()

HttpAsynchReq::HttpAsynchReq ( )

Uninitialized storage; initialize before use or destruction.