本文整理汇总了Java中org.cybergarage.upnp.ssdp.SSDPNotifySocketList.start方法的典型用法代码示例。如果您正苦于以下问题:Java SSDPNotifySocketList.start方法的具体用法?Java SSDPNotifySocketList.start怎么用?Java SSDPNotifySocketList.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cybergarage.upnp.ssdp.SSDPNotifySocketList
的用法示例。
在下文中一共展示了SSDPNotifySocketList.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.cybergarage.upnp.ssdp.SSDPNotifySocketList; //导入方法依赖的package包/类
public boolean start(String target, int mx) {
stop();
int retryCnt = 0;
int bindPort = getHTTPPort();
HTTPServerList httpServerList = getHTTPServerList();
while (!httpServerList.open(bindPort)) {
retryCnt++;
if (100 < retryCnt) {
return false;
}
setHTTPPort(bindPort + 1);
bindPort = getHTTPPort();
}
httpServerList.addRequestListener(this);
httpServerList.start();
SSDPNotifySocketList ssdpNotifySocketList = getSSDPNotifySocketList();
if (!ssdpNotifySocketList.open()) {
return false;
}
ssdpNotifySocketList.setControlPoint(this);
ssdpNotifySocketList.start();
int ssdpPort = getSSDPPort();
retryCnt = 0;
SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
while (!ssdpSearchResponseSocketList.open(ssdpPort)) {
retryCnt++;
if (100 < retryCnt) {
return false;
}
setSSDPPort(ssdpPort + 1);
ssdpPort = getSSDPPort();
}
ssdpSearchResponseSocketList.setControlPoint(this);
ssdpSearchResponseSocketList.start();
search(target, mx);
Disposer disposer = new Disposer(this);
setDeviceDisposer(disposer);
disposer.start();
if (isNMPRMode()) {
RenewSubscriber renewSub = new RenewSubscriber(this);
setRenewSubscriber(renewSub);
renewSub.start();
}
return true;
}
示例2: start
import org.cybergarage.upnp.ssdp.SSDPNotifySocketList; //导入方法依赖的package包/类
public boolean start(String target, int mx)
{
stop();
////////////////////////////////////////
// HTTP Server
////////////////////////////////////////
int retryCnt = 0;
int bindPort = getHTTPPort();
HTTPServerList httpServerList = getHTTPServerList();
while (httpServerList.open(bindPort) == false) {
retryCnt++;
if (UPnP.SERVER_RETRY_COUNT < retryCnt)
return false;
setHTTPPort(bindPort + 1);
bindPort = getHTTPPort();
}
httpServerList.addRequestListener(this);
httpServerList.start();
////////////////////////////////////////
// Notify Socket
////////////////////////////////////////
SSDPNotifySocketList ssdpNotifySocketList = getSSDPNotifySocketList();
if (ssdpNotifySocketList.open() == false)
return false;
ssdpNotifySocketList.setControlPoint(this);
ssdpNotifySocketList.start();
////////////////////////////////////////
// SeachResponse Socket
////////////////////////////////////////
int ssdpPort = getSSDPPort();
retryCnt = 0;
SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
while (ssdpSearchResponseSocketList.open(ssdpPort) == false) {
retryCnt++;
if (UPnP.SERVER_RETRY_COUNT < retryCnt)
return false;
setSSDPPort(ssdpPort + 1);
ssdpPort = getSSDPPort();
}
ssdpSearchResponseSocketList.setControlPoint(this);
ssdpSearchResponseSocketList.start();
////////////////////////////////////////
// search root devices
////////////////////////////////////////
search(target, mx);
////////////////////////////////////////
// Disposer
////////////////////////////////////////
Disposer disposer = new Disposer(this);
setDeviceDisposer(disposer);
disposer.start();
////////////////////////////////////////
// Subscriber
////////////////////////////////////////
if (isNMPRMode() == true) {
RenewSubscriber renewSub = new RenewSubscriber(this);
setRenewSubscriber(renewSub);
renewSub.start();
}
return true;
}