|
CEF3 C++ API Docs - Version 80.1.4+g8927396+chromium-80.0.3987.149 | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
CefBaseRefCounted | +--CefServerin cef_server.h
Class representing a server that supports HTTP and WebSocket requests. Server capacity is limited and is intended to handle only a small number of simultaneous connections (e.g. for communicating between applications on localhost). The methods of this class are safe to call from any thread in the brower process unless otherwise indicated.
Inner Classes, Typedefs, and Enums | |
typedef |
CefServer::HeaderMap
|
Method Summary | |
virtual void |
CloseConnection( int connection_id )= 0
Close the connection identified by |connection_id|. |
static void |
CreateServer( const CefString& address, uint16 port, int backlog, CefRefPtr< CefServerHandler > handler )
Create a new server that binds to |address| and |port|. |
virtual CefString |
GetAddress()= 0
Returns the server address including the port number. |
virtual CefRefPtr< CefTaskRunner > |
GetTaskRunner()= 0
Returns the task runner for the dedicated server thread. |
virtual bool |
HasConnection()= 0
Returns true if the server currently has a connection. |
virtual bool |
IsRunning()= 0
Returns true if the server is currently running and accepting incoming connections. |
virtual bool |
IsValidConnection( int connection_id )= 0
Returns true if |connection_id| represents a valid connection. |
virtual void |
SendHttp200Response( int connection_id, const CefString& content_type, const void* data, size_t data_size )= 0
Send an HTTP 200 "OK" response to the connection identified by |connection_id|. |
virtual void |
SendHttp404Response( int connection_id )= 0
Send an HTTP 404 "Not Found" response to the connection identified by |connection_id|. |
virtual void |
SendHttp500Response( int connection_id, const CefString& error_message )= 0
Send an HTTP 500 "Internal Server Error" response to the connection identified by |connection_id|. |
virtual void |
SendHttpResponse( int connection_id, int response_code, const CefString& content_type, int64 content_length, const CefServer::HeaderMap& extra_headers )= 0
Send a custom HTTP response to the connection identified by |connection_id|. |
virtual void |
SendRawData( int connection_id, const void* data, size_t data_size )= 0
Send raw data directly to the connection identified by |connection_id|. |
virtual void |
SendWebSocketMessage( int connection_id, const void* data, size_t data_size )= 0
Send a WebSocket message to the connection identified by |connection_id|. |
virtual void |
Shutdown()= 0
Stop the server and shut down the dedicated server thread. |
Methods inherited from class CefBaseRefCounted |
AddRef, Release, HasOneRef, HasAtLeastOneRef |
Method Detail |
public virtual void CloseConnection( int connection_id )= 0;
public static void CreateServer( const CefString& address, uint16 port, int backlog, CefRefPtr< CefServerHandler > handler );
public virtual CefString GetAddress()= 0;
public virtual CefRefPtr< CefTaskRunner > GetTaskRunner()= 0;
public virtual bool HasConnection()= 0;
public virtual bool IsRunning()= 0;
public virtual bool IsValidConnection( int connection_id )= 0;
public virtual void SendHttp200Response( int connection_id, const CefString& content_type, const void* data, size_t data_size )= 0;
public virtual void SendHttp404Response( int connection_id )= 0;
public virtual void SendHttp500Response( int connection_id, const CefString& error_message )= 0;
public virtual void SendHttpResponse( int connection_id, int response_code, const CefString& content_type, int64 content_length, const CefServer::HeaderMap& extra_headers )= 0;
public virtual void SendRawData( int connection_id, const void* data, size_t data_size )= 0;
public virtual void SendWebSocketMessage( int connection_id, const void* data, size_t data_size )= 0;
public virtual void Shutdown()= 0;
|
CEF3 C++ API Docs - Version 80.1.4+g8927396+chromium-80.0.3987.149 | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |