Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
server.c File Reference

HTTP Server handler. More...

#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include "soletta.h"
#include "sol-http.h"
#include "sol-http-server.h"
#include "sol-util.h"
#include "sol-util-file.h"

Functions

static bool on_stdin (void *data, int fd, uint32_t flags)
 
static int request_cb (void *data, struct sol_http_request *request)
 
static void shutdown_server (void)
 
 SOL_MAIN_DEFAULT (startup_server, shutdown_server)
 
static void startup_server (void)
 

Variables

static struct sol_http_serverserver
 
static struct sol_fd * stdin_watch
 
static struct sol_buffer value
 

Detailed Description

HTTP Server handler.

Sample server that return a text/plain string. The content of this is read from stdin. To see the usage help, -h or –help.

Function Documentation

static bool on_stdin ( void *  data,
int  fd,
uint32_t  flags 
)
static
static int request_cb ( void *  data,
struct sol_http_request request 
)
static
static void shutdown_server ( void  )
static
SOL_MAIN_DEFAULT ( startup_server  ,
shutdown_server   
)
static void startup_server ( void  )
static

Variable Documentation

struct sol_http_server* server
static

Referenced by shutdown_server(), and startup_server().

struct sol_fd* stdin_watch
static

Referenced by startup_server().

struct sol_buffer value
static