1

The problem: any tethered app that I create in Delphi XE10 works only when both apps are run on the same machine (PC or Mac) or with a Mac/ios pairing. PC/mac and PC/ios fail. I've tried the MediaPlayer samples that come with RAD Studio XE10 (in C:\Users\Public\Documents\Embarcadero\Studio\17.0\Samples\Object Pascal\Multi-Device Samples\Device Sensors and Services\App Tethering) and it fails to connect in the same way (fails with PC/Mac and PC/ios). Since the PC seems to be the common factor, I thought this might be a firewall problem but nothing looked out of place and I even tried this with the firewall turned off and it still didn't work)

For some actual code, I'll use a sample from a tutorial that also fails in the same way for me: (Tutorial available: http://www.malcolmgroves.com/blog/?p=1854)

  • Start with two multi-device (firemonkey) applications (app1 and app2) - create each in a separate instance of Delphi XE10
  • In both, drop in a TetheringManager and a TetheringAppProfile.
  • In both, Select your TetheringManager as the Manager in the TetheringAppProfile
  • In App1 drop in a button and a label
  • In App2 drop in a label
  • in App2 set the password for the TetheringManager to The wingless dove protects its nest

App1 Code:

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 Code:

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;

When compiled/built/deployed the behavior differs depending on the targets as discussed above and charted below.

+---------------------------+  
| 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 |
+-------+-------+-----------+  
b-p
  • 307
  • 3
  • 10
  • I take it the PC mac and iOS devices are all on the same subnet? – Dsm Feb 29 '16 at 08:59
  • yes - xxx.xxx.xxx.6 (phone), xxx.xxx.xxx.52 (PC) and xxx.xxx.xxx.13 (Mac) – b-p Feb 29 '16 at 10:45
  • Do you use windows firewall on the PC, and do you use WiFi for transfers? The reason I ask is because a WiFi router can sometimes be considered an edge device on windows firewall's (I not sure that anyone but Microsoft understands when) and you may need to allow edge transfers on the PC firewall. – Dsm Feb 29 '16 at 10:54
  • I do use wifi but it doesn't even work when the firewall is turned off. I do think it has something to do with the PC, however. How would I configure the firewall to allow edge transfers? I checked with Wireshark and it seems that the phone and PC do actually communicate but don't establish the apptether. – b-p Feb 29 '16 at 23:24
  • 1
    Exact details will change with operation system, but on mine it is in Inbound rules - select the rule appropriate to your port/application, properties, click the advanced tab, and allow edge traversal. However, I am not hopeful that it will make a difference. I assume that your subnet mask is the usual 255.255.255.0? I think that I would concentrate on getting PC1 to PC2 working. I certainly have achieved that. Sorry I can't be more help. – Dsm Mar 01 '16 at 09:55
  • One extra thought - you are sure that you just have one firewall active? Not, for example, and anti-virus that operates its own firewall, like McAfee? – Dsm Mar 01 '16 at 09:58
  • subnet mask is the usual and I don't have a secondary firewall active. I will try getting PC1 to PC2 to work - I think that's a good idea. Did you try these examples on PC1/PC2 or another tethering example? btw, I appreciate your input! – b-p Mar 01 '16 at 12:57
  • It was a different example. Actually on reflection I may only have tried it on one PC. Failing memory - sorry. In the end I just used Indy components. – Dsm Mar 01 '16 at 14:57
  • Just an additional suggestion - to avoid any issues with router firewalls (although I think they are an unlikely source of your problem) I would suggest linking your two PCs directly together with CAT-5 (most modern PCs allow this) and do not use WiFi for tests. – Dsm Mar 02 '16 at 08:55

1 Answers1

0

i had the same problem for long time and fight with it until today, all i have to do is create the inbound & outbound rules in the firewall (Control Panel\System and Security\Windows Firewall\advanced settings) and set the program file with his path and open all ports an allow all the connections type, and i got it.

Tuto
  • 21
  • 4