HTTP-2-lib
Static Public Member Functions
h2_callbacks Class Reference

#include <h2_callbacks.hpp>

Static Public Member Functions

static void readCallback (struct bufferevent *bufferEvent, void *ptr)
 
static void writeCallback (struct bufferevent *bufferEvent, void *ptr)
 
static void eventCallback (struct bufferevent *bufferEvent, short events, void *ptr)
 
static void acceptCallback (struct evconnlistener *conListener, int sock, struct sockaddr *address, int address_length, void *arg)
 

Member Function Documentation

◆ acceptCallback()

void h2_callbacks::acceptCallback ( struct evconnlistener *  conListener,
int  sock,
struct sockaddr *  address,
int  address_length,
void *  arg 
)
static

Creates a ClientSessionData object for the new accepted connection and sets callbacks for the created bufferevent object.

Parameters
conListener- evconnlistener struct object
sock- filedscriptor for the connection
address- clients address
address_length- length of clients address
arg- user supplied ApplicationContext object.

◆ eventCallback()

void h2_callbacks::eventCallback ( struct bufferevent *  bufferEvent,
short  events,
void *  ptr 
)
static

Callback invoked when there is an event on the sock filedescriptor.

Parameters
bufferEvent- bufferevent object associated with the connection.
events- flag type conjunction of error and/or event type.
ptr- clientSessionData object for the connection.

◆ readCallback()

void h2_callbacks::readCallback ( struct bufferevent *  bufferEvent,
void *  ptr 
)
static

Callback triggered when there is data to be read in the evbuffer.

Parameters
bufferEvent- The bufferevent that triggered the callback.
ptr- The user-specified context for this bufferevent, which is the ClientSessionData object.

◆ writeCallback()

void h2_callbacks::writeCallback ( struct bufferevent *  bufferEvent,
void *  ptr 
)
static

Callback invoked when all data in the session's buffer has been sent and the buffer is empty. It has not been implemented as of yet, but with time the library will change from responding to client requests directly with a bufferwrite, to adding response data to a linked list queued for transmission and sending it by invoking a function 'sendSessionData()'. With time this will be implemented.

Parameters
bufferEvent- The connections bufferevent object.
ptr- The connections ClientSessionData object, which will hold the linked list of data queued for transmission

The documentation for this class was generated from the following files: