本文整理汇总了Java中javax.jmdns.ServiceInfo.getSubtype方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceInfo.getSubtype方法的具体用法?Java ServiceInfo.getSubtype怎么用?Java ServiceInfo.getSubtype使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.jmdns.ServiceInfo
的用法示例。
在下文中一共展示了ServiceInfo.getSubtype方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serviceAdded
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
/**
* A service has been added.
*
* @param event
* service event
*/
@Override
public void serviceAdded(ServiceEvent event) {
synchronized (this) {
ServiceInfo info = event.getInfo();
if ((info != null) && (info.hasData())) {
_infos.put(event.getName(), info);
} else {
String subtype = (info != null ? info.getSubtype() : "");
info = ((JmDNSImpl) event.getDNS()).resolveServiceInfo(event.getType(), event.getName(), subtype, true);
if (info != null) {
_infos.put(event.getName(), info);
} else {
_events.put(event.getName(), event);
}
}
}
}
示例2: serviceAdded
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
/**
* A service has been added.
*
* @param event
* service event
*/
@Override
public void serviceAdded(ServiceEvent event)
{
synchronized (this)
{
ServiceInfo info = event.getInfo();
if ((info != null) && (info.hasData()))
{
_infos.put(event.getName(), info);
}
else
{
String subtype = (info != null ? info.getSubtype() : "");
info = ((JmDNSImpl) event.getDNS()).resolveServiceInfo(event.getType(), event.getName(), subtype, true);
if (info != null)
{
_infos.put(event.getName(), info);
}
else
{
_events.put(event.getName(), event);
}
}
}
}
示例3: ServiceInfoImpl
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
/**
* During recovery we need to duplicate service info to reregister them
*
* @param info
*/
public ServiceInfoImpl(ServiceInfo info)
{
if (info != null)
{
this._domain = info.getDomain();
this._protocol = info.getProtocol();
this._application = info.getApplication();
this._name = info.getName();
this._subtype = info.getSubtype();
this._port = info.getPort();
this._weight = info.getWeight();
this._priority = info.getPriority();
this._text = info.getTextBytes();
this._persistent = info.isPersistent();
this._ipv4Addr = info.getInet4Address();
this._ipv6Addr = info.getInet6Address();
}
this._state = new ServiceInfoState(this);
}