NetServices Stack source

Dependents:   HelloWorld ServoInterfaceBoardExample1 4180_Lab4

Embed: (wiki syntax)

« Back to documentation index

HTTPServer Class Reference

HTTPServer Class Reference

A simple HTTP server implementation. More...

#include <HTTPServer.h>

Public Member Functions

 HTTPServer ()
 Instantiates the HTTP Server.
template<typename T >
void addHandler (const char *path)
 Adds a handler.
void bind (int port=80)
 Starts listening.

Detailed Description

A simple HTTP server implementation.

The HTTPServer is composed of:

  • The actual server (HTTPServer)
  • A request dispatcher, instanciated on each request (HTTPRequestDispatcher)
  • Request handlers instanciated by the dispatcher(deriving from HTTPRequestHandler)

Definition at line 51 of file HTTPServer.h.

Constructor & Destructor Documentation

HTTPServer (  )

Instantiates the HTTP Server.

Definition at line 29 of file HTTPServer.cpp.

Member Function Documentation

void addHandler ( const char *  path )

Adds a handler.

Appends a handler to the handlers list

T: class which will be instanciated to serve these requests
path: requests starting with this path will be served using this handler

Definition at line 79 of file HTTPServer.h.

void bind ( int  port = 80 )

Starts listening.

Binds server to a specific port and starts listening

port: port on which to listen for incoming connections

Definition at line 40 of file HTTPServer.cpp.