zoukankan      html  css  js  c++  java
  • mormot2 TRestHttpServer

    mormot2 TRestHttpServer

    TRestHttpServer = class(TSynPersistentLock)

    /// HTTP/1.1 RESTFUL JSON mORMot Server class
    // - this server is multi-threaded and not blocking
    // - under Windows, it will first try to use fastest http.sys kernel-mode
    // server (i.e. create a THttpApiServer instance); it should work OK under XP
    // or WS 2K3 - but you need to have administrator rights under Vista or Seven:
    // if http.sys fails to initialize, it will use the socket-based THttpServer;
    // a solution is to call the THttpApiServer.AddUrlAuthorize class method during
    // program setup for the desired port, or define a useHttpApiRegisteringURI
    // kind of server, in order to allow it for every user
    // - under Linux, only THttpServer is available
    // - you can specify useBidirSocket kind of server (i.e. TWebSocketServerRest)
    // if you want the HTTP protocol connection to be upgraded to a WebSockets
    // mode, to allow immediate callbacks from the server to the client
    // - just create it and it will serve SQL statements as UTF-8 JSON
    // - for a true AJAX server, expanded data is prefered - your code may contain:
    // ! DBServer.NoAjaxJson := false;

    /// HTTP/1.1 RESTFUL JSON mORMot服务器类

    // -这个服务器是多线程的,不阻塞

    // -在Windows下,它将首先尝试使用最快的http.sys系统内核模式

    //创建一个THttpApiServer实例在XP下应该可以工作

    //或WS 2K3 -但你需要在Vista或7下有管理员权限:

    / /如果http.sys初始化失败,它将使用基于套接字的THttpServer;

    //一个解决方案是调用THttpApiServer。AddUrlAuthorize期间的类方法

    //程序设置所需的端口,或定义一个useHttpApiRegisteringURI

    //类型的服务器,以便允许它为每个用户

    // - Linux下,只有THttpServer可用

    // -你可以指定使用bidirsocket类型的服务器(即TWebSocketServerRest)

    //如果你想要HTTP协议连接升级到一个WebSockets

    //模式,允许从服务器立即回调到客户端

    // -只需创建它,它将作为UTF-8 JSON提供SQL语句

    // -对于一个真正的AJAX服务器,扩展数据是首选-你的代码可能包含:

    / / !DBServer。NoAjaxJson: = false;

  • 相关阅读:
    printf和sprintf
    操作数、运算符、表达式
    全自动加法机
    Ascll、GB2312、Ansi
    数组
    循环
    编程命名规范
    浮点数及缺陷
    Android编码规范
    RGB着色对照表
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/15013781.html
Copyright © 2011-2022 走看看