未验证 提交 af50b0f1 编写于 作者: O openharmony_ci 提交者: Gitee

!20470 MDNS示例代码存在冗余

Merge pull request !20470 from liyufan/master
......@@ -116,20 +116,6 @@ class EntryAbility extends UIAbility {
}
let context = globalThis.context;
// 建立LocalService对象
let localServiceInfo = {
serviceType: "_print._tcp",
serviceName: "servicename",
port: 5555,
host: {
address: "10.14.**.***",
},
serviceAttribute: [{
key: "111",
value: [1]
}]
}
// 创建DiscoveryService对象,用于发现指定服务类型的mDNS服务
let serviceType = "_print._tcp";
let discoveryService = mdns.createDiscoveryService(context, serviceType);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册