CSCI3081W Drone Delivery System
|
Base class for web server implementation. More...
#include <WebServer.h>
Classes | |
class | Session |
Represents a session with a client. More... | |
Public Member Functions | |
WebServerBase (int port=8081, const std::string &webDir=".") | |
Constructor for WebServerBase. More... | |
virtual | ~WebServerBase () |
Destructor. | |
void | service (int time=10) |
Services the server, processing incoming requests. More... | |
virtual void | createSession (void *info) |
Creates a session for a new client connection. More... | |
Public Attributes | |
lws_context * | context = nullptr |
std::vector< Session * > | sessions |
std::map< int, Session * > | sessionMap |
std::string | webDir |
Protected Member Functions | |
virtual Session * | createSession () |
Factory method to create a new session. | |
Base class for web server implementation.
Copyright (c) 2019 Dan Orban
WebServerBase::WebServerBase | ( | int | port = 8081 , |
const std::string & | webDir = "." |
||
) |
Constructor for WebServerBase.
port | The port on which the server will listen |
webDir | The directory from which to serve web content |
|
virtual |
Creates a session for a new client connection.
info | Pointer to information about the session |
void WebServerBase::service | ( | int | time = 10 | ) |
Services the server, processing incoming requests.
time | Time for which to service the server |