jf-framework
Loading...
Searching...
No Matches
server.c File Reference
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <http.h>
#include <netinet/in.h>
#include <server.h>
#include <stddef.h>
#include <sys/socket.h>
Include dependency graph for server.c:

Functions

Serverjf_CreateServer (int32_t port)
 Creates server struct.
uint32_t jf_Listen (Server *server)
 Opens listening socket.
uint32_t jf_RunSever (Server *server)
 Accept loop.
uint32_t jf_HandleClient (Server *server)
void jf_DestroyServer (Server *server)
 Closes server and frees resources.

Detailed Description

Author
Avis

HTTP server

Function Documentation

◆ jf_CreateServer()

Server * jf_CreateServer ( int32_t port)

Creates server struct.

Author
Avis
Returns
NULL on failure and pointer to server on sucess

◆ jf_DestroyServer()

void jf_DestroyServer ( Server * server)

Closes server and frees resources.

Author
Avis
Parameters
serverPointer to server struct

◆ jf_HandleClient()

uint32_t jf_HandleClient ( Server * server)
Author
Victor
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ jf_Listen()

uint32_t jf_Listen ( Server * server)

Opens listening socket.

Author
victor

◆ jf_RunSever()

uint32_t jf_RunSever ( Server * server)

Accept loop.

Author
victor
Parameters
serverPointer to server struct
Returns
Return code
Here is the call graph for this function: