miniserver.h File Reference
`#include "sock.h"`
`#include "httpparser.h"`
`#include "UpnpStdInt.h"`
Include dependency graph for miniserver.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | MServerSockArray

## Typedefs

typedef struct MServerSockArray | MiniServerSockArray
typedef void(* | MiniServerCallback) (http_parser_t *parser, http_message_t *request, SOCKINFO *info)

## Functions

void | SetHTTPGetCallback (MiniServerCallback callback)
| Set HTTP Get Callback. More...
void | SetSoapCallback (MiniServerCallback callback)
| Set SOAP Callback. More...
void | SetGenaCallback (MiniServerCallback callback)
| Set GENA Callback. More...
int | StartMiniServer (uint16_t *listen_port4, uint16_t *listen_port6)
| Initialize the sockets functionality for the Miniserver. More...
int | StopMiniServer ()
| Stop and Shutdown the MiniServer and free socket resources. More...

## Variables

SOCKET | gMiniServerStopSock

## Typedef Documentation

## MiniServerCallback

typedef void(* MiniServerCallback) ( http_parser_t *parser, http_message_t *request, SOCKINFO *info)

## Function Documentation

## SetGenaCallback()

void SetGenaCallback | ( | MiniServerCallback | callback | ) |

Set GENA Callback.

Parameters

  [in] | callback | GENA Callback to be invoked.

## SetHTTPGetCallback()

void SetHTTPGetCallback | ( | MiniServerCallback | callback | ) |

Set HTTP Get Callback.

Parameters

  [in] | callback | HTTP Callback to be invoked .

## SetSoapCallback()

void SetSoapCallback | ( | MiniServerCallback | callback | ) |

Set SOAP Callback.

Parameters

  [in] | callback | SOAP Callback to be invoked .

## StartMiniServer()

int StartMiniServer | ( | uint16_t * | listen_port4,
|  | uint16_t * | listen_port6
| ) |  |

Initialize the sockets functionality for the Miniserver.

Initialize a thread pool job to run the MiniServer and the job to the thread pool.

If listen port is 0, port is dynamically picked.

Use timer mechanism to start the MiniServer, failure to meet the allowed delay aborts the attempt to launch the MiniServer.

Returns
  - On success: UPNP_E_SUCCESS.
  - On error: UPNP_E_XXX.

Parameters

  [in,out] | listen_port4 | Port on which the server listens for incoming IPv4 connections.
  [in,out] | listen_port6 | Port on which the server listens for incoming IPv6 connections.

References gMServState, MSERV_IDLE, UPNP_E_INTERNAL_ERROR, and UPNP_E_OUTOF_MEMORY.

## StopMiniServer()

int StopMiniServer | ( |  | ) |

Stop and Shutdown the MiniServer and free socket resources.

Returns
  Always returns 0.