1

good evening! I am trying to make a connection with Tethering, following the explanations of Malcon Groves (http://www.malcolmgroves.com/blog/?p=1854), however I am having the following problem:

When you click Connect, App1 apparently connects, but does not display the App2 handle.

App2 happens the same thing .... ....

I inserted the tetheringappprofile and tetheringmanager components and made the settings indicated ....

The codes are:

//App1
procedure TForm1.ConnectClick(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 := '1234';
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

Thanks!

sounobre
  • 420
  • 1
  • 6
  • 16
  • Does the example code in my answer to this q https://stackoverflow.com/questions/42140246/delphi-how-to-get-all-images-from-server-database-by-using-app-tethering work for you? – MartynA Jan 26 '18 at 23:26
  • OT: I'd like to know how many developers actually used that "technology" in real. – Victoria Jan 27 '18 at 00:48
  • @Victoria This is one reason I don't use it: https://quality.embarcadero.com/browse/RSP-19194. This problem discounts being able to have an app that uses it, on the App Store – Dave Nottage Jan 27 '18 at 01:59
  • 1
    Are the two apps running on the same network? Can the two machines ping each other? Did you give them permission on the firewall? – Jim McKeeth Jan 27 '18 at 02:10
  • 1
    @Dave, thanks! But I bet there's more. Pity they don't focus for example to WebSocket (for example on recent Windows with RIO sockets). It's not that difficult (I'm about to release in few months with a friend of mine a library that can do all that "new" stuff most probably for free). – Victoria Jan 27 '18 at 02:13
  • 1
    @Victoria Well, since I wasn't able to connect on IPv6 (IPv4 worked), I didn't go any further with it. I'd be interested in your library. It might be able to fit into something I'm working on – Dave Nottage Jan 27 '18 at 02:18
  • @Dave, the thing we're working on is the interface for at least recent Windows (if we stay at one platform). We're working with non blocking socket implementation with the "new" Windows thread pool API (but not only that, RIO is a bit different, and more efficient when speaking about that CPU design flaw for Windows). We'd appreciate any help with the interface. If you want, contact me at victoria.nope@mail.com and we can cooperate on that. We'd be happy to build a stable API (actually anyone who wants to participate, but beware that languages like C# have it for free and open sourced!). – Victoria Jan 27 '18 at 02:37
  • @Victoria: "I'd like to know how" Yes, I wondered that when I tried answering the q I linked, starting from zero knowledge apart from Malcom's blogs. I found that with a little forethought about firewalls etc, it works remarkably well, at least using IP4 on my LAN.. The biggest problem I saw was the bugginess of the "new" JSON-based DataSnap transport, which fails with large Stream transfers (but not, curiously, with string transfers). – MartynA Jan 27 '18 at 13:06

1 Answers1

0

When you use AutoConnect to discover other apps, the TetheringAppProfile.Group property in both apps has to be same.

Malcolm Groves has indeed great series of articles about App Tethering. I also attended presentation from Jens Fudge about the subject. Otherwise very hard to master. Thank you guys!

Delphi ships itself with number of useful samples about App Tethering. They are located in directory: ..\Samples\Object Pascal\RTL\Tethering\

@Dave: connection through IPv6 should be possible. Did you try AllowedAdapters property? http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.Tether.Manager.TTetheringManager.AllowedAdapters

Erwin
  • 1,896
  • 1
  • 11
  • 17