为什么可能连接的firemonkey应用程序不能工作PC-> Mac或PC-> ios(但可用于PC-> PC和Mac-> ios)?

为什么可能连接的firemonkey应用程序不能工作PC-> Mac或PC-> ios(但可用于PC-> PC和Mac-> ios)?

问题描述:

问题:我在Delphi XE10中创建的任何连接的应用程序仅在两个应用程序在同一台计算机(PC或Mac)上运行或Mac/ios配对时运行。 PC/Mac和PC/ios失败。我已经试过了RAD Studio XE10附带的MediaPlayer样本(位于C:\ Users \ Public \ Documents \ Embarcadero \ Studio \ 17.0 \ Samples \ Object Pascal \ Multi-Device Samples \ Device Sensors and Services \ App Tethering中)和它无法以同样的方式连接(PC/Mac和PC/ios失败)。由于PC似乎是共同的因素,我认为这可能是一个防火墙问题,但没有看起来不合适的地方,我甚至在防火墙关闭的情况下尝试了这种方式,但它仍然不起作用)为什么可能连接的firemonkey应用程序不能工作PC-> Mac或PC-> ios(但可用于PC-> PC和Mac-> ios)?

对于某些实际的代码,我将使用一个样本从一个教程,也没有以同样的方式对我来说:(教程可供选择:http://www.malcolmgroves.com/blog/?p=1854

  • 开始两个多设备(firemonkey)应用程序(应用与应用2) - 创建的每个在Delphi XE10的单独实例中
  • 在两者中都放入TetheringManager和TetheringAppProfile。
  • 在两者中选择您TetheringManager作为TetheringAppProfile
  • 在一个按钮,应用1滴和标签
  • 在应用2滴在标签中的应用2
  • 设置了TetheringManager密码的经理无翅鸠保护它的巢

应用1代码:

procedure TForm1.Button1Click(Sender: TObject); 
begin 
    TetheringManager1.AutoConnect(); 
end; 

procedure TForm1.FormCreate(Sender: TObject); 
begin 
    Caption := format('App1 : %s', [tetheringmanager1.Identifier]); 
end; 

procedure TForm1.TetheringManager1PairedToRemote(const Sender: TObject; const AManagerInfo: TTetheringManagerInfo); 
begin 
    label1.Text := Format('Connected : %s %s', [amanagerinfo.ManagerIdentifier, amanagerinfo.ManagerName]); 
end; 

procedure TForm1.TetheringManager1RequestManagerPassword(const Sender: TObject; const ARemoteIdentifier: string; var Password: string); 
begin 
    Password := 'The wingless dove protects its nest'; 
end; 

App2的代码:

procedure TForm1.FormCreate(Sender: TObject); 
begin 
    caption := format('App2 : %s', [tetheringmanager1.Identifier]); 
end; 

procedure TForm1.TetheringManager1PairedFromLocal(const Sender: TObject; const AManagerInfo: TTetheringManagerInfo); 
begin 
    label1.Text := Format('Connected : %s %s', [amanagerinfo.ManagerIdentifier, amanagerinfo.ManagerName]); 
end; 

当编译/内置/部署的行为取决于如上所讨论的和在下面指明的目标不同。

+---------------------------+ 
| App1 | App2 | Outcome | 
+-------+-------+-----------+ 
| PC1 | PC1 | success | 
+-------+-------+-----------+ 
| PC1 | Mac | Failure | 
+-------+-------+-----------+ 
| PC1 | ios | Failure | 
+-------+-------+-----------+ 
| ios | PC1 | Failure | 
+-------+-------+-----------+ 
| ios | Mac | Failure | 
+-------+-------+-----------+ 
| Mac | ios | Success | 
+-------+-------+-----------+ 
| Mac | Mac | Success | 
+-------+-------+-----------+ 
| Mac | PC1 | Failure | 
+-------+-------+-----------+ 
| PC1 | PC2 | Failure | 
+-------+-------+-----------+ 
| PC2 | PC2 | Success | 
+-------+-------+-----------+ 
+0

我把PC mac和iOS设备都放在同一个子网上? – Dsm

+0

是 - xxx.xxx.xxx.6(phone),xxx.xxx.xxx.52(PC)和xxx.xxx.xxx.13(Mac) –

+0

您是否在PC上使用Windows防火墙,并且使用WiFi转移?我问的原因是因为WiFi路由器有时可以被视为Windows防火墙上的边缘设备(我不确定除了微软之外任何人都可以理解),并且您可能需要在PC防火墙上允许边缘传输。 – Dsm

我有很长一段时间同样的问题,与它战斗,直到今天,我所要做的就是在防火墙创建入站&出站规则(控制面板\系统和安全\ Windows防火墙\高级设置)并用他的路径设置程序文件并打开所有端口并允许所有连接类型,并且我知道了。