Retrieves a connection from the pool. Make sure to close the connection when you are done with it.
GetConnectionAsync (EventNameAsString)
Asynchronously gets a SQL connection. This method is useful in UI applications as it prevents the main thread from freezing until the connection is available. The ConnectionReady event will be raised when the connection is ready.
Represents a HTTP cookie. You can add cookies to the response with ServletResponse.AddCookie. These cookies will then be sent in the following browser requests. You can fetch the cookies with ServletRequest.GetCookies.
Gets or sets whether the cookie is a http only cookie (a cookie that cannot be read by client-side scripts).
Initialize (NameAsString, ValueAsString)
Creates a new cookie with the given name and value.
IsInitializedAsBoolean
MaxAgeAsInt
Gets or sets the cookie maximum age in seconds. A negative value means that the cookie will be deleted when the Web browser exists. A zero value causes the cookie to be deleted.
HttpSessions allows you to identify a user across multiple requests and to store data specific to this user. The session id is stored as a cookie in the user browser, or as a URL parameter if cookies are disabled. The data is stored in the server memory. Getting and creating sessions is done with ServletRequest.GetSession.
Returns the value tied to the attribute with the specified name. Returns the DefaultValue if no value exists.
GetAttributesNamesAsList
Returns a List with all the session names.
HasAttribute (NameAsString) AsBoolean
Tests whether there is a value tied to the given name.
IdAsString [read only]
Returns the session unique id.
Invalidate
Invalidates the session. This causes the session to be deleted.
IsInitializedAsBoolean
IsNewAsBoolean [read only]
Returns true if the session was created in this request.
LastAccessedTimeAsLong [read only]
Returns the last time the user sent a request associated with this session.
MaxInactiveIntervalAsInt
Gets or sets the maximum inactive interval, in seconds. The session will be invalidated if there was not any activity for a period larger than this value. The default value is -1 which means that there is no maximum interval.
RemoveAttribute (NameAsString)
Removes the attribute with the given name.
SetAttribute (NameAsString, ValueAsObject)
Adds an attribute to the session. If there is an existing value with the same name then it will be replaced.
Change (Params As Map) Click (Params As Map) DblClick (Params As Map) Focus (Params As Map) FocusIn (Params As Map) FocusOut (Params As Map) KeyUp (Params As Map) MouseDown (Params As Map) MouseEnter (Params As Map) MouseLeave (Params As Map) MouseMove (Params As Map) MouseUp (Params As Map)
Adds a background worker. An instance of the specified class will be created and initialized from a background thread. Class - The class name. The class should be a standard class (not server handler).
You can call StartMessageLoop in the Initialize sub to keep the class instance running for as long as needed. Note that in debug mode the code will be executed by the main thread.
AddDoSFilter (PathAsString, SettingsAsMap)
Adds a filter that protects against intentional or unintentional denial of service attacks. It restricts the number of requests sent from the same connection. Path - The filter will be mapped to the given path. You can use wildcards in the path. Settings - An optional map with various settings. See this link: DoS Filter Documentation
Maps a filter class. Path - The filter will be mapped to the following path. You can use wildcards in the path. Class - The class name (string). SingleThreadHandler - Whether this handler should always run in the main thread.
Maps a handler class. Path - The handler will be mapped to the following path. You can use wildcards in the path. Class - The class name (string). SingleThreadHandler - Whether this handler should always run in the main thread.
AddWebSocket (PathAsString, ClassAsString)
Maps a WebSocket class. Path - The WebSocket will be mapped to this path. Class - WebSocket class (string).
CreateThreadSafeMapAsMap
Returns an initialized Map that can safely be accessed by multiple threads (based on Java ConcurrentHashMap). Unlike the standard Map the order of items is not preserved. Note that this Map does not support the following methods: GetKeyAt and GetValueAt.
CurrentThreadIndexAsInt [read only]
Each thread is mapped to a specific index. This property returns the current thread index. Note that the main thread index is always 0.
DebugNetworkLatencyAsInt [write only]
Sets the emulated network latency in debug mode, measured in milliseconds. Default value is 100. You should only call this method before the server is started. The emulated latency only affects server -> client -> server round-trips.
GzipEnabledAsBoolean [write only]
Calling this method will cause the server to compress the responses if the client supports GZIP responses and the resource mime type is not of a known compressed type. In most cases it should be enabled.
Http2EnabledAsBoolean
Gets or sets whether Http/2.0 is enabled. Note that it requires some configuration (see the tutorial for more information).
Initialize (EventNameAsString)
Initializes the server. EventName is currently not used.
LogsFileFolderAsString
Gets or sets the logs files folder.
LogsRetainDaysAsInt
Gets or sets the number of days the rotated logs will be kept.
LogWaitingMessagesAsBoolean
Sets whether "waiting for value" messages are logged. These messages can help you to optimize the code and reduce the network latency effects.
PortAsInt
Gets or sets the server port.
SetCustomErrorPages (PagesMapAsMap)
This method allows you to set custom error pages. The PagesMap maps between status codes (such as 404 and 500) and the handlers or pages that will be called for each error. This method should be called before the server is started. Example: DimerrAsMap err.Initialize err.Put(404, "/404.html") 'map to a custom page srvr.SetCustomErrorPages(err)
Parses a multipart request and returns a Map with the parsed Parts as values and the parts names as keys. Folder - The files will be saved in this folder. MaxSize - The request maximum size.
GetParameter (NameAsString) AsString
Returns the parameter value or an empty string if the parameter does not exist.
GetParameterValues (NameAsString) AsString()
GetSessionAsHttpSession
Gets the user session. A new session will be created if this is the first request from this user.
InputStreamAsInputStreamWrapper [read only]
Returns an InputStream that allows you to read directly from the request body.
IsInitializedAsBoolean
MethodAsString [read only]
Returns the HTTP method (GET or POST).
ParameterMapAsMap [read only]
Returns a Map with all the parameter. The keys are the parameters names (strings) and the values are the parameters values (arrays of strings).
RemoteAddressAsString [read only]
Returns the client IP address.
RequestURIAsString [read only]
Returns the request URL without the host and any parameters.
SecureAsBoolean [read only]
Returns true if the request was made with a secure channel (SSL).