Ejemplo n.º 1
0
        private static unsafe void OnWebSocketRequestImpl(cef_server_handler_t *self, cef_server_t *server, int connection_id, cef_string_t *client_address, cef_request_t *request, cef_callback_t *callback)
        {
            var instance = GetInstance((IntPtr)self) as CefServerHandler;

            if (instance == null || ((ICefServerHandlerPrivate)instance).AvoidOnWebSocketRequest())
            {
                ReleaseIfNonNull((cef_base_ref_counted_t *)server);
                ReleaseIfNonNull((cef_base_ref_counted_t *)request);
                ReleaseIfNonNull((cef_base_ref_counted_t *)callback);
                return;
            }
            instance.OnWebSocketRequest(CefServer.Wrap(CefServer.Create, server), connection_id, CefString.Read(client_address), CefRequest.Wrap(CefRequest.Create, request), CefCallback.Wrap(CefCallback.Create, callback));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Open the response stream. To handle the request immediately set
 /// |handle_request| to true (1) and return true (1). To decide at a later time
 /// set |handle_request| to false (0), return true (1), and execute |callback|
 /// to continue or cancel the request. To cancel the request immediately set
 /// |handle_request| to true (1) and return false (0). This function will be
 /// called in sequence but not from a dedicated thread. For backwards
 /// compatibility set |handle_request| to false (0) and return false (0) and
 /// the ProcessRequest function will be called.
 /// </summary>
 protected internal unsafe virtual bool Open(CefRequest request, ref int handleRequest, CefCallback callback)
 {
     return(default);
Ejemplo n.º 3
0
 /// <summary>
 /// 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 cef_server_t::SendWebSocketMessage function after
 /// receiving the OnWebSocketConnected callback to respond with WebSocket
 /// messages.
 /// </summary>
 protected internal unsafe virtual void OnWebSocketRequest(CefServer server, int connectionId, string clientAddress, CefRequest request, CefCallback callback)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Open the response stream. To handle the request immediately set
 /// |handle_request| to true (1) and return true (1). To decide at a later time
 /// set |handle_request| to false (0), return true (1), and execute |callback|
 /// to continue or cancel the request. To cancel the request immediately set
 /// |handle_request| to true (1) and return false (0). This function will be
 /// called in sequence but not from a dedicated thread. For backwards
 /// compatibility set |handle_request| to false (0) and return false (0) and
 /// the ProcessRequest function will be called.
 /// </summary>
 public unsafe virtual bool Open(CefRequest request, ref int handleRequest, CefCallback callback)
 {
     return(default);