AXHttp
ax_http_server_socket.h File Reference

The AXHttpServerSocket and its associated functions. More...

Go to the source code of this file.

Typedefs

typedef void(* SocketRequestCallback) (const gchar *path, const gchar *method, const gchar *query, GHashTable *parameters, gint reply_fd, gpointer user_data)
 This is the prototype of the callback function called whenever an matching http request is received. More...
 
typedef struct _AXHttpServerSocket AXHttpServerSocket
 The AXHttpServerSocket is an opaque data type.
 

Functions

AXHttpServerSocketax_http_server_socket_new (const gchar *name, SocketRequestCallback request_callback, gpointer user_data)
 Creates a new AXHttpServerSocket. More...
 
void ax_http_server_socket_free (AXHttpServerSocket *socket)
 Destroys the AXHttpServerSocket. Any pending callbacks associated with theAXHttpServerSocket will be cancelled. More...
 

Detailed Description

The AXHttpServerSocket and its associated functions.

Typedef Documentation

◆ SocketRequestCallback

typedef void(* SocketRequestCallback) (const gchar *path, const gchar *method, const gchar *query, GHashTable *parameters, gint reply_fd, gpointer user_data)

This is the prototype of the callback function called whenever an matching http request is received.

Parameters
pathThe path on which the request was made.
methodThe http method used for the request.
queryThe full query string.
parametersA GHashTable with parameters.
reply_fdThe file descriptor to be used for the reply.
user_dataOptional user data.

Function Documentation

◆ ax_http_server_socket_new()

AXHttpServerSocket* ax_http_server_socket_new ( const gchar *  name,
SocketRequestCallback  request_callback,
gpointer  user_data 
)

Creates a new AXHttpServerSocket.

Returns
a newly allocated AXHttpServerSocket.

References ax_http_server_socket_free().

Referenced by ax_http_handler_new().

◆ ax_http_server_socket_free()

void ax_http_server_socket_free ( AXHttpServerSocket socket)

Destroys the AXHttpServerSocket. Any pending callbacks associated with theAXHttpServerSocket will be cancelled.

Parameters
socketa AXHttpServerSocket.

Referenced by ax_http_handler_free(), and ax_http_server_socket_new().