第一个 macOS 64位 kbmmw 服务器
前几天,Delphi 10.3.2 正式发布,这个小版本升级却增加了一个非常大的平台支持,增加了
macos 64位的支持,今天做一个macOS 64位的kbmmw应用,让kbmmw 服务器的应用更广泛。
当然了,你需要先根据要求,设置好相关的·macos64 的开发环境。

首先我们新建一个FMX 应用。
设置对应的参数
procedure TForm2.Button1Click(Sender: TObject);
begin
kbmmwserver1.AutoRegisterServices;
kbmmwserver1.Active:=true;
end;
平台上添加mac os64

新建一个kbmmw 服务。


服务名设为mactest,生成一个服务,并修改代码如下:
type
[kbmMW_Service('name:mactest, flags:[listed]')]
[kbmMW_Rest('path:/mactest')]
// Access to the service can be limited using the [kbmMW_Auth..] attribute.
// [kbmMW_Auth('role:[SomeRole,SomeOtherRole], grant:true')]
TkbmMWCustomHTTPSmartService1 = class(TkbmMWCustomHTTPSmartService)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
// HelloWorld function callable from both a regular client,
// due to the optional [kbmMW_Method] attribute,
// and from a REST client due to the optional [kbmMW_Rest] attribute.
// The access path to the function from a REST client (like a browser)+
// is in this case relative to the services path.
// In this example: http://.../mactest/helloworld
// Access to the function can be limited using the [kbmMW_Auth..] attribute.
// [kbmMW_Auth('role:[SomeRole,SomeOtherRole], grant:true')]
[kbmMW_Rest('method:get, path:helloworld')]
[kbmMW_Method]
function HelloWorld:string;
[kbmMW_Method]
function version:string;
[kbmMW_Method]
function EchoString(const AString:string):string;
[kbmMW_Method]
function AddNumbers(const AValue1,AValue2:integer;
[kbmMW_Arg(mwatRemoteLocation)]
const ARemoteLocation:string
):integer ;
end;
implementation
{%CLASSGROUP 'System.Classes.TPersistent'}
uses kbmMWExceptions, mainp;
{$R *.dfm}
// Service definitions.
//---------------------
function TkbmMWCustomHTTPSmartService1.AddNumbers(const AValue1,
AValue2: integer; const ARemoteLocation: string): integer;
begin
Result:=AValue1+AValue2;
end;
function TkbmMWCustomHTTPSmartService1.EchoString(
const AString: string): string;
begin
Result:=AString;
end;
function TkbmMWCustomHTTPSmartService1.HelloWorld:string;
begin
Result:='Hello world';
end;
function TkbmMWCustomHTTPSmartService1.version: string;
begin
result:='kbmmw server for macos 64';
end;
initialization
TkbmMWRTTI.EnableRTTI(TkbmMWCustomHTTPSmartService1);
end.
服务端做好了
我们可以运行了。

现在做一个简单客户端

设置对应的代码
procedure TForm1.Button1Click(Sender: TObject);
var
c:IkbmMWSmartClient;
s:string; begin
Transport.Host:=eIP.Text; // Get a client which establishes connection over the given transport
// to the given service which is set to be default for this client.
c:=TkbmMWSmartRemoteClientFactory.GetClient(Transport,'MACTEST'); s:=c.Service. helloworld ;
memo1.Lines.Add(s);
s:=c.Service.EchoString('abc');
memo1.Lines.Add(s);
s:=c.Service.version;
memo1.Lines.Add(s);
s:=c.Service.AddNumbers(,);
memo1.Lines.Add(s); end;
运行客户端

正确运行。
基本上比较顺利。
第一个 macOS 64位 kbmmw 服务器的更多相关文章
- Windows下64位Apache服务器的安装
转自:http://www.blogjava.net/greatyuqing/archive/2013/02/13/395308.html 首先需要说明的是,Apaceh服务器没有官方的64位版本,只 ...
- 64位Navicat Premium-11.2.7(64bit)访问64位Oracle服务器
1 在windows 10 64位操作系统安装Navicat Premium-11.2.7(64bit). 2 在服务器安装64位的Oracle(win64_11gR2_database). 3 在h ...
- Ubuntu 16.04 64位 tftp服务器搭建
TFTP(Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂.开销不大的文件传输服务 ...
- Centos6.2_(64位)服务器环境配置:源码编译Nginx
目标软件都指定安装目录:/apps.由于Nginx可以使用正则表达式来匹配访问路径, 要正常使用此功能就保证安装有Pcre库,如果你已经接着上一篇操作过来,就可以不用考虑这一点,因为此库已经在安装列表 ...
- CentOS6.3(64位)下安装Oracle11gR2(64)服务器
安装环境 Linux服务器:Centos6.3 64位 Oracle服务器:Oracle11gR2 64位 系统要求 1.Linux安装Oracle系统要求 系统要求 说明 内存 必须高于1G的物理内 ...
- 它来了!!!有史以来第一个64位Visual Studio(2022)预览版将在今夏发布!
美国时间2021年4月19日,微软产品研发部一位负责人Amanda Silver在其博客上发布一则<Visual Studio 2022>的消息,表示将在今年(2021年)夏天发布Visu ...
- 连接英文字符集的ORACLE和调用存储过程问题及64位服务器连接ORACLE问题
部署在IIS上的webservice连接英文字符集的ORACLE数据库出现问题“未在本地计算机上注册"MSDAORA.1"提供程序”,解决方案如下: 原因:如错误,64位系统未注册 ...
- 三道题(关于虚表指针位置/合成64位ID/利用栈实现四则运算)
第一题 C++标准中,虚表指针在类的内存结构位置没有规定,不同编译器的实现可能是不一样的.请实现一段代码,判断当前编译器把虚表指针放在类的内存结构的最前面还是最后面. 第二题 在游戏中所有物品的实例 ...
- 64位WINDOWS系统环境下应用软件开发的兼容性问题(CPU 注册表 目录)
应用软件开发的64 位WINDOWS 系统环境兼容性 1. 64 位CPU 硬件 目前的64位CPU分为两类:x64和IA64.x64的全称是x86-64,从名字上也可以看出来它和 x86是兼容的,原 ...
随机推荐
- HandlerMethodReturnValueHandler SpringMVC 参数解析 继承关系以及各解析器解析类型
I HandlerMethodReturnValueHandler (org.springframework.web.method.support) AbstractMessageConverterM ...
- scrapy爬虫案例:问政平台
问政平台 http://wz.sun0769.com/index.php/question/questionType?type=4 爬取投诉帖子的编号.帖子的url.帖子的标题,和帖子里的内容. it ...
- 设置ESXi宿主机开机自动启动虚拟机
转载于 https://blog.csdn.net/Form_/article/details/71170813 在百度上面找了一圈都是讲ESXi6.0之前的版本,在VMware vSphere Cl ...
- Angular8开发拼多多WebApp_汇总贴
https://coding.imooc.com/class/336.html?mc_marking=b9f5e475d0cb8922d899d416f5b4433f&mc_channel=s ...
- [Linux.centOS].安装Redis 腾讯云
环境 { "服务器运营商":"腾讯云", "操作系统":"CentOS 7.5 64位", "CPU" ...
- LwIP应用开发笔记之四:LwIP无操作系统TFTP服务器
前面我们已经实现了UDP的回环客户端和回环服务器的简单应用,接下来我们实现一个基于UDP的简单文件传输协议TFTP. 1.TFTP协议简介 TFTP是TCP/IP协议族中的一个用来在客户机与服务器之间 ...
- 【转】Notepad++如何设置行高
Notepad++行高没有提供正式的设置方法,但可以通过一个 hack 来调整: 在[设置]「Style Configurator」对话框(中文是「语言格式设置」)里选择语言的地方选第一项「Globa ...
- CentOS 7上重新编译安装nginx
CentOS 7的源所提供的nginx几乎不包含任何扩展模块:为了能够使用一些扩展模块,我们需要从源代码重新编译安装nginx. 目前最新版的源代码是1.6.1.下载解压后先不要急着configure ...
- RabbitMQ使用及与spring boot整合
1.MQ 消息队列(Message Queue,简称MQ)——应用程序和应用程序之间的通信方法 应用:不同进程Process/线程Thread之间通信 比较流行的中间件: ActiveMQ Rabbi ...
- 【jquery】【jqGrid】设置不能多选
onSelectAll:function(rowids,statue){ layui.layer.msg("请选择单条记录"); $("#jqGrid").jq ...