【发布时间】:2018-01-26 23:14:01
【问题描述】:
晚上好! 根据 Malcon Groves (http://www.malcolmgroves.com/blog/?p=1854) 的解释,我正在尝试与 Tethering 建立联系,但是我遇到了以下问题:
当您单击连接时,App1 显然已连接,但不显示 App2 句柄。
App2 发生同样的事情 .... ....
我插入了 tetheringappprofile 和 tetheringmanager 组件并进行了指示的设置....
代码是:
//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;
谢谢!
【问题讨论】:
-
我对这个 q stackoverflow.com/questions/42140246/… 的回答中的示例代码对你有用吗?
-
OT:我想知道有多少开发者真正使用过这种“技术”。
-
这两个应用程序是否在同一个网络上运行?两台机器能互相ping通吗?您是否授予他们使用防火墙的权限?
-
@Dave,谢谢!但我敢打赌还有更多。可惜他们没有关注例如 WebSocket(例如在最近的带有 RIO 套接字的 Windows 上)。这并不难(我将在几个月后和我的一个朋友一起发布一个库,该库很可能是免费的)。
-
@Victoria 好吧,因为我无法在 IPv6 上连接(IPv4 工作),所以我没有进一步使用它。我会对你的图书馆感兴趣。它可能适合我正在做的事情