g_server = maxon::NetworkWebServerClass().Create()
iferr_return;
const bool useSSL = false;
g_server.ObservableHandleRequest(
true).AddObserver(WebServerCallback)
iferr_return;
const char const char * name
Definition: abstract.h:195
Definition: string.h:1237
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:170
static const WILDCARD_IPV4_ADDRESS_TYPE WILDCARD_IPV4_ADDRESS
Definition: network_ip_addr.h:45
static const Int WILDCARD_IP_PORT
Any IP port.
Definition: network_ip_addr.h:60
maxon::NetworkIpAddrPort NetworkIpAddrPort
Definition: operatingsystem.h:315
#define iferr_return
Definition: resultbase.h:1524
The behaviour of the web-server is defined by implementing the ObservableHandleRequest. The callback function reacts to an incoming HTTP request and can return a message or an error.
static maxon::Result<void> WebServerCallback(
const maxon::NetworkWebServerRef& server,
const maxon::NetworkHttpHandlerRef& remoteConnection,
const maxon::DataDictionary& request)
{
const maxon::Bool keepAlive = connectionType.FindUpper(
"KEEP-ALIVE"_s,
nullptr, 0);
const maxon::Bool isGetOrPostRequest = isGetRequest || isPostRequest;
if (isGetOrPostRequest && keepAlive)
{
if (fileLower == "marco"_s)
{
}
}
}
Definition: string.h:1492
const char * message
Definition: pyerrors.h:189
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:202
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:195
return OK
Definition: apibase.h:2735
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
PyWideStringList Py_ssize_t length
Definition: initconfig.h:448
@ CALL_NEXT_HANDLER
the request was not processed by this message handler, continue with the next one.
@ NOTFOUND
return a http file not found error.
HTTPREQUESTTYPE
Definition: network_webserver.h:284
#define iferr_scope
Definition: resultbase.h:1389
const char const char const char * file
Definition: object.h:439