本文整理匯總了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);
}