C#P2P:未设置对等方的数据和注释

问题描述 投票:0回答:1

我正在尝试在对等体中插入数据,但它不起作用。

我留下我正在使用的代码:

PeerNameRegistration pnReg = new PeerNameRegistration();
pnReg.PeerName = peerName;
pnReg.Start();
pnReg.Port = 80;
pnReg.Comment = txtName.Text;
pnReg.Data = System.Text.Encoding.UTF8.GetBytes("Data");
pnReg.Stop(); (?)

当我检查对等体时,我可以看到4个节点,但它们都没有数据或注释。

c# p2p
1个回答
0
投票

在调用Start()方法之前,您必须指定proprties的值。如果要在注册peer之后更改属性的值,可以使用Update()方法。

© www.soinside.com 2019 - 2024. All rights reserved.