# Class TCEFServerRef

Description
Hierarchy
Methods

## Unit

uCEFServer

## Declaration

`type TCEFServerRef = class(TCefBaseRefCountedRef, ICefServer)`

## Description

This item has no description.

## Hierarchy

- TInterfacedObject
- TCefBaseRefCountedRef
- TCEFServerRef

## Overview

### Methods

Protected | `function GetTaskRunner: ICefTaskRunner; virtual;`
Protected | `procedure Shutdown; virtual;`
Protected | `function IsRunning: boolean; virtual;`
Protected | `function GetAddress: ustring; virtual;`
Protected | `function HasConnection: boolean; virtual;`
Protected | `function IsValidConnection(connection_id: Integer) : boolean; virtual;`
Protected | `procedure SendHttp200response(connection_id: Integer; const content_type: ustring; const data: Pointer; data_size: NativeUInt); virtual;`
Protected | `procedure SendHttp404response(connection_id: Integer); virtual;`
Protected | `procedure SendHttp500response(connection_id: Integer; const error_message: ustring); virtual;`
Protected | `procedure SendHttpResponse(connection_id, response_code: Integer; const content_type: ustring; content_length: int64; const extra_headers: ICefStringMultimap); virtual;`
Protected | `procedure SendRawData(connection_id: Integer; const data: Pointer; data_size: NativeUInt); virtual;`
Protected | `procedure CloseConnection(connection_id: Integer); virtual;`
Protected | `procedure SendWebSocketMessage(connection_id: Integer; const data: Pointer; data_size: NativeUInt); virtual;`
Public | `class function UnWrap(data: Pointer): ICefServer;`

## Description

### Methods

Protected | `function GetTaskRunner: ICefTaskRunner; virtual;`
This item has no description. Showing description inherited from ICefServer.GetTaskRunner. Returns the task runner for the dedicated server thread.

Protected | `procedure Shutdown; virtual;`
This item has no description. Showing description inherited from ICefServer.Shutdown. Stop the server and shut down the dedicated server thread. See ICefServerHandler.OnServerCreated documentation for a description of server lifespan.

Protected | `function IsRunning: boolean; virtual;`
This item has no description. Showing description inherited from ICefServer.IsRunning. Returns true (1) if the server is currently running and accepting incoming connections. See ICefServerHandler.OnServerCreated documentation for a description of server lifespan. This function must be called on the dedicated server thread.

Protected | `function GetAddress: ustring; virtual;`
This item has no description. Showing description inherited from ICefServer.GetAddress. Returns the server address including the port number.

Protected | `function HasConnection: boolean; virtual;`
This item has no description. Showing description inherited from ICefServer.HasConnection. Returns true (1) if the server currently has a connection. This function must be called on the dedicated server thread.

Protected | `function IsValidConnection(connection_id: Integer) : boolean; virtual;`
This item has no description. Showing description inherited from ICefServer.IsValidConnection. Returns true (1) if |connection_id| represents a valid connection. This function must be called on the dedicated server thread.

Protected | `procedure SendHttp200response(connection_id: Integer; const content_type: ustring; const data: Pointer; data_size: NativeUInt); virtual;`
This item has no description. Showing description inherited from ICefServer.SendHttp200response. Send an HTTP 200 "OK" response to the connection identified by |connection_id|. |content_type| is the response content type (e.g. "text/html"), |data| is the response content, and |data_size| is the size of |data| in bytes. The contents of |data| will be copied. The connection will be closed automatically after the response is sent.

Protected | `procedure SendHttp404response(connection_id: Integer); virtual;`
This item has no description. Showing description inherited from ICefServer.SendHttp404response. Send an HTTP 404 "Not Found" response to the connection identified by |connection_id|. The connection will be closed automatically after the response is sent.

Protected | `procedure SendHttp500response(connection_id: Integer; const error_message: ustring); virtual;`
This item has no description. Showing description inherited from ICefServer.SendHttp500response. Send an HTTP 500 "Internal Server Error" response to the connection identified by |connection_id|. |error_message| is the associated error message. The connection will be closed automatically after the response is sent.

Protected | `procedure SendHttpResponse(connection_id, response_code: Integer; const content_type: ustring; content_length: int64; const extra_headers: ICefStringMultimap); virtual;`
This item has no description. Showing description inherited from ICefServer.SendHttpResponse. Send a custom HTTP response to the connection identified by |connection_id|. |response_code| is the HTTP response code sent in the status line (e.g. 200), |content_type| is the response content type sent as the "Content-Type" header (e.g. "text/html"), |content_length| is the expected content length, and |extra_headers| is the map of extra response headers. If |content_length| is >= 0 then the "Content-Length" header will be sent. If |content_length| is 0 then no content is expected and the connection will be closed automatically after the response is sent. If |content_length| is < 0 then no "Content-Length" header will be sent and the client will continue reading until the connection is closed. Use the SendRawData function to send the content, if applicable, and call CloseConnection after all content has been sent.

Protected | `procedure SendRawData(connection_id: Integer; const data: Pointer; data_size: NativeUInt); virtual;`
This item has no description. Showing description inherited from ICefServer.SendRawData. Send raw data directly to the connection identified by |connection_id|. |data| is the raw data and |data_size| is the size of |data| in bytes. The contents of |data| will be copied. No validation of |data| is performed internally so the client should be careful to send the amount indicated by the "Content-Length" header, if specified. See SendHttpResponse documentation for intended usage.

Protected | `procedure CloseConnection(connection_id: Integer); virtual;`
This item has no description. Showing description inherited from ICefServer.CloseConnection. Close the connection identified by |connection_id|. See SendHttpResponse documentation for intended usage.

Protected | `procedure SendWebSocketMessage(connection_id: Integer; const data: Pointer; data_size: NativeUInt); virtual;`
This item has no description. Showing description inherited from ICefServer.SendWebSocketMessage. Send a WebSocket message to the connection identified by |connection_id|. |data| is the response content and |data_size| is the size of |data| in bytes. The contents of |data| will be copied. See ICefServerHandler.OnWebSocketRequest documentation for intended usage.

Public | `class function UnWrap(data: Pointer): ICefServer;`
This item has no description.

Generated by PasDoc 1.0.4.