mvm_gui_set_webserver_optionsT_mvm_gui_set_webserver_optionsMvmGuiSetWebserverOptionsMvmGuiSetWebserverOptions (Operator)

Name

mvm_gui_set_webserver_optionsT_mvm_gui_set_webserver_optionsMvmGuiSetWebserverOptionsMvmGuiSetWebserverOptions — Set webserver options for a given server in JSON format.

Signature

mvm_gui_set_webserver_options( : : ServerHandle, JsonOptions : )

Herror T_mvm_gui_set_webserver_options(const Htuple ServerHandle, const Htuple JsonOptions)

void MvmGuiSetWebserverOptions(const HTuple& ServerHandle, const HTuple& JsonOptions)

static void HHdevguiServerExtpack.MvmGuiSetWebserverOptions(HTuple serverHandle, HTuple jsonOptions)

Description

Set webserver options for a given server in JSON format. Multiple options can be specified as multiple key/values pairs within a single JSON object string representation.

Supported options are:

socketReceiveTimeout: The timeout for receiving data in milliseconds. The default is the system maximum integer value.

socketSendTimeout: The timeout for sending data in milliseconds. The default is the system maximum integer value.

watcherTimeoutMillis: Wait watcherTimeoutMillis milliseconds before triggering the system message '__fileChangesDetected' after a filesystem change event occured. Use a value <= 0 to disable the file system watcher. The default value is 0 / disabled.

watcherExcludeDirs: Exclude these directories from the file system watcher.

ackTimeoutMillis: The timeout for receiving acknowledge messages in milliseconds. An acknowledge message is received from a client for each 'tuple' message sent from the server. Use a value <= 0 to disable waiting for acknowledge messages. The default value is 250 milliseconds. Please note that if acknowledge messages are disabled the operator mvm_gui_get_uimvm_gui_get_uiMvmGuiGetUiMvmGuiGetUiMvmGuiGetUi will probably not return meaningful results.

rootDir: The root directory of the server. The specified string must be an absolute path to an existing directory or a path relative to the current working directory (see also set_current_dirset_current_dirSetCurrentDirSetCurrentDirSetCurrentDir). The directory is resolved immediately when this option is specified. It is therefore OK to change the working directory afterwards.

File system watcher

The File system watcher installs an change event watcher on all files within the specified root directory of the webserver and for its subdirectories (recursive). If any file is modified while a webclient is connected, the webclient will receive a '__fileChangesDetected' system message. The default JavaScript implementation then triggers a page reload (window.location.reload()). For example, this functionality can be used to see immediately the effect of an edit of a HTML page. This functionality is disabled be default. It can be enabled by setting the option watcherTimeoutMillis as described above.

Execution Information

This operator modifies the state of the following input parameter:

The value of this parameter may not be shared across multiple threads without external synchronization.

Parameters

ServerHandleServerHandleServerHandleServerHandleserverHandle (input_control, state is modified)  serial HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

GUI server handle

JsonOptionsJsonOptionsJsonOptionsJsonOptionsjsonOptions (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

options in JSON notation

Example (HDevelop)

mvm_gui_set_webserver_options (ServerHandle, '{"socketReceiveTimeout": 100000, "ackTimeoutMillis": 100}')
mvm_gui_set_webserver_options (ServerHandle, '{"watcherTimeoutMillis": 100, "ackTimeoutMillis": -1}')

See also

mvm_gui_get_webserver_optionsmvm_gui_get_webserver_optionsMvmGuiGetWebserverOptionsMvmGuiGetWebserverOptionsMvmGuiGetWebserverOptions

Module

Foundation