本文整理汇总了Java中javax.jmdns.impl.JmDNSImpl.ServiceTypeEntry类的典型用法代码示例。如果您正苦于以下问题:Java ServiceTypeEntry类的具体用法?Java ServiceTypeEntry怎么用?Java ServiceTypeEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceTypeEntry类属于javax.jmdns.impl.JmDNSImpl包,在下文中一共展示了ServiceTypeEntry类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addAnswers
import javax.jmdns.impl.JmDNSImpl.ServiceTypeEntry; //导入依赖的package包/类
@Override
protected DNSOutgoing addAnswers(DNSOutgoing out) throws IOException {
DNSOutgoing newOut = out;
long now = System.currentTimeMillis();
for (String type : this.getDns().getServiceTypes().keySet()) {
ServiceTypeEntry typeEntry = this.getDns().getServiceTypes().get(type);
newOut = this.addAnswer(newOut, new DNSRecord.Pointer("_services._dns-sd._udp.local.", DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, typeEntry.getType()), now);
}
return newOut;
}
开发者ID:iilxy,项目名称:AndroidmDNS,代码行数:11,代码来源:TypeResolver.java
示例2: addAnswers
import javax.jmdns.impl.JmDNSImpl.ServiceTypeEntry; //导入依赖的package包/类
@Override
public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) {
// find matching services
for (ServiceInfo serviceInfo : jmDNSImpl.getServices().values()) {
this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) serviceInfo);
}
if (this.isServicesDiscoveryMetaQuery()) {
for (String serviceType : jmDNSImpl.getServiceTypes().keySet()) {
ServiceTypeEntry typeEntry = jmDNSImpl.getServiceTypes().get(serviceType);
answers.add(new DNSRecord.Pointer("_services._dns-sd._udp.local.", DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, typeEntry.getType()));
}
} else if (this.isReverseLookup()) {
String ipValue = this.getQualifiedNameMap().get(Fields.Instance);
if ((ipValue != null) && (ipValue.length() > 0)) {
InetAddress address = jmDNSImpl.getLocalHost().getInetAddress();
String hostIPAddress = (address != null ? address.getHostAddress() : "");
if (ipValue.equalsIgnoreCase(hostIPAddress)) {
if (this.isV4ReverseLookup()) {
answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_A, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL));
}
if (this.isV6ReverseLookup()) {
answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_AAAA, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL));
}
}
}
} else if (this.isDomainDiscoveryQuery()) {
// FIXME [PJYF Nov 16 2010] We do not currently support domain discovery
}
}
开发者ID:iilxy,项目名称:AndroidmDNS,代码行数:30,代码来源:DNSQuestion.java
注:本文中的javax.jmdns.impl.JmDNSImpl.ServiceTypeEntry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论