# Class TCustomServerHandler

Description
Hierarchy
Fields
Methods

## Unit

uCEFServerHandler

## Declaration

`type TCustomServerHandler = class(TCEFServerHandlerOwn)`

## Description

This item has no description.

## Hierarchy

- TInterfacedObject
- TCefBaseRefCountedOwn
- TCEFServerHandlerOwn
- TCustomServerHandler

## Overview

### Fields

Protected | `FEvents: Pointer;`

### Methods

Protected | `procedure OnServerCreated(const server: ICefServer); override;`
Protected | `procedure OnServerDestroyed(const server: ICefServer); override;`
Protected | `procedure OnClientConnected(const server: ICefServer; connection_id: Integer); override;`
Protected | `procedure OnClientDisconnected(const server: ICefServer; connection_id: Integer); override;`
Protected | `procedure OnHttpRequest(const server: ICefServer; connection_id: Integer; const client_address: ustring; const request: ICefRequest); override;`
Protected | `procedure OnWebSocketRequest(const server: ICefServer; connection_id: Integer; const client_address: ustring; const request: ICefRequest; const callback: ICefCallback); override;`
Protected | `procedure OnWebSocketConnected(const server: ICefServer; connection_id: Integer); override;`
Protected | `procedure OnWebSocketMessage(const server: ICefServer; connection_id: Integer; const data: Pointer; data_size: NativeUInt); override;`
Public | `constructor Create(const events: IServerEvents); reintroduce;`
Public | `destructor Destroy; override;`

## Description

### Fields

Protected | `FEvents: Pointer;`
This item has no description.

### Methods

Protected | `procedure OnServerCreated(const server: ICefServer); override;`
This item has no description. Showing description inherited from ICefServerHandler.OnServerCreated. Called when |server| is created. If the server was started successfully then ICefServer.IsRunning will return true (1). The server will continue running until ICefServerShutdown is called, after which time OnServerDestroyed will be called. If the server failed to start then OnServerDestroyed will be called immediately after this function returns.

Protected | `procedure OnServerDestroyed(const server: ICefServer); override;`
This item has no description. Showing description inherited from ICefServerHandler.OnServerDestroyed. Called when |server| is destroyed. The server thread will be stopped after this function returns. The client should release any references to |server| when this function is called. See OnServerCreated documentation for a description of server lifespan.

Protected | `procedure OnClientConnected(const server: ICefServer; connection_id: Integer); override;`
This item has no description. Showing description inherited from ICefServerHandler.OnClientConnected. Called when a client connects to |server|. |connection_id| uniquely identifies the connection. Each call to this function will have a matching call to OnClientDisconnected.

Protected | `procedure OnClientDisconnected(const server: ICefServer; connection_id: Integer); override;`
This item has no description. Showing description inherited from ICefServerHandler.OnClientDisconnected. Called when a client disconnects from |server|. |connection_id| uniquely identifies the connection. The client should release any data associated with |connection_id| when this function is called and |connection_id| should no longer be passed to ICefServer functions. Disconnects can originate from either the client or the server. For example, the server will disconnect automatically after a ICefServer.SendHttpXXXResponse function is called.

Protected | `procedure OnHttpRequest(const server: ICefServer; connection_id: Integer; const client_address: ustring; const request: ICefRequest); override;`
This item has no description. Showing description inherited from ICefServerHandler.OnHttpRequest. Called when |server| receives an HTTP request. |connection_id| uniquely identifies the connection, |client_address| is the requesting IPv4 or IPv6 client address including port number, and |request| contains the request contents (URL, function, headers and optional POST data). Call ICefServer functions either synchronously or asynchronusly to send a response.

Protected | `procedure OnWebSocketRequest(const server: ICefServer; connection_id: Integer; const client_address: ustring; const request: ICefRequest; const callback: ICefCallback); override;`
This item has no description. Showing description inherited from ICefServerHandler.OnWebSocketRequest. Called when |server| receives a WebSocket request. |connection_id| uniquely identifies the connection, |client_address| is the requesting IPv4 or IPv6 client address including port number, and |request| contains the request contents (URL, function, headers and optional POST data). Execute |callback| either synchronously or asynchronously to accept or decline the WebSocket connection. If the request is accepted then OnWebSocketConnected will be called after the WebSocket has connected and incoming messages will be delivered to the OnWebSocketMessage callback. If the request is declined then the client will be disconnected and OnClientDisconnected will be called. Call the ICefServer.SendWebSocketMessage function after receiving the OnWebSocketConnected callback to respond with WebSocket messages.

Protected | `procedure OnWebSocketConnected(const server: ICefServer; connection_id: Integer); override;`
This item has no description. Showing description inherited from ICefServerHandler.OnWebSocketConnected. Called after the client has accepted the WebSocket connection for |server| and |connection_id| via the OnWebSocketRequest callback. See OnWebSocketRequest documentation for intended usage.

Protected | `procedure OnWebSocketMessage(const server: ICefServer; connection_id: Integer; const data: Pointer; data_size: NativeUInt); override;`
This item has no description. Showing description inherited from ICefServerHandler.OnWebSocketMessage. Called when |server| receives an WebSocket message. |connection_id| uniquely identifies the connection, |data| is the message content and |data_size| is the size of |data| in bytes. Do not keep a reference to |data| outside of this function. See OnWebSocketRequest documentation for intended usage.

Public | `constructor Create(const events: IServerEvents); reintroduce;`
This item has no description.

Public | `destructor Destroy; override;`
This item has no description.

Generated by PasDoc 1.0.4.