org.cybergarage.upnp.Device.announce()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.cybergarage.upnp.Device.announce()方法的一些代码示例,展示了Device.announce()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.announce()方法的具体详情如下:
包路径:org.cybergarage.upnp.Device
类名称:Device
方法名:announce

Device.announce介绍

暂无

代码示例

代码示例来源:origin: i2p/i2p.i2p

public void run() 
  {
    Device dev = getDevice();
    long leaseTime = dev.getLeaseTime();
    long notifyInterval;
    while (isRunnable() == true) {
      notifyInterval = (leaseTime/4) + (long)((float)leaseTime * (Math.random() * 0.25f));
      notifyInterval *= 1000;
      try {
        Thread.sleep(notifyInterval);
      } catch (InterruptedException e) {}
      dev.announce();
    }
  }
}

代码示例来源:origin: i2p/i2p.i2p

public void setLeaseTime(int value) {
  getDeviceData().setLeaseTime(value);
  Advertiser adv = getAdvertiser();
  if (adv != null) {
    announce();
    adv.restart();
  }
}

代码示例来源:origin: i2p/i2p.i2p

public void announce() {
  notifyWait();
  InetAddress[] binds = getDeviceData().getHTTPBindAddress();
  String[] bindAddresses;
  if (binds != null) {
    bindAddresses = new String[binds.length];
    for (int i = 0; i < binds.length; i++) {
      bindAddresses[i] = binds[i].getHostAddress();
    }
  } else {
    int nHostAddrs = HostInterface.getNHostAddresses();
    bindAddresses = new String[nHostAddrs];
    for (int n = 0; n < nHostAddrs; n++) {
      bindAddresses[n] = HostInterface.getHostAddress(n);
    }
  }
  for (int j = 0; j < bindAddresses.length; j++) {
    if (bindAddresses[j] == null || bindAddresses[j].length() == 0)
      continue;
    int ssdpCount = getSSDPAnnounceCount();
    for (int i = 0; i < ssdpCount; i++)
      announce(bindAddresses[j]);
  }
}

代码示例来源:origin: i2p/i2p.i2p

announce();

代码示例来源:origin: cybergarage/cybergarage-upnp

public void run() 
  {
    Device dev = getDevice();
    long leaseTime = dev.getLeaseTime();
    long notifyInterval;
    while (isRunnable() == true) {
      notifyInterval = (leaseTime/4) + (long)((float)leaseTime * (Math.random() * 0.25f));
      notifyInterval *= 1000;
      try {
        Thread.sleep(notifyInterval);
      } catch (InterruptedException e) {}
      dev.announce();
    }
  }
}

代码示例来源:origin: geniusgithub/MediaPlayer

public void run() 
  {
    Device dev = getDevice();
    long leaseTime = dev.getLeaseTime();
    long notifyInterval;
    while (isRunnable() == true) {
      notifyInterval = (leaseTime/4) + (long)((float)leaseTime * (Math.random() * 0.25f));
      notifyInterval *= 1000;
      try {
        Thread.sleep(notifyInterval);
      } catch (InterruptedException e) {}
      dev.announce();
    }
  }
}

代码示例来源:origin: cybergarage/cybergarage-upnp

public void setLeaseTime(int value) {
  getDeviceData().setLeaseTime(value);
  Advertiser adv = getAdvertiser();
  if (adv != null) {
    announce();
    adv.restart();
  }
}

代码示例来源:origin: geniusgithub/MediaPlayer

public void setLeaseTime(int value) {
  getDeviceData().setLeaseTime(value);
  Advertiser adv = getAdvertiser();
  if (adv != null) {
    announce();
    adv.restart();
  }
}

代码示例来源:origin: i2p/i2p.i2p

for (int n = 0; n < childDeviceCnt; n++) {
  Device childDevice = childDeviceList.getDevice(n);
  childDevice.announce(bindAddr);

代码示例来源:origin: geniusgithub/MediaPlayer

public void announce() {
  notifyWait();
  InetAddress[] binds = getDeviceData().getHTTPBindAddress();
  String[] bindAddresses;
  if (binds != null) {
    bindAddresses = new String[binds.length];
    for (int i = 0; i < binds.length; i++) {
      bindAddresses[i] = binds[i].getHostAddress();
    }
  } else {
    int nHostAddrs = HostInterface.getNHostAddresses();
    bindAddresses = new String[nHostAddrs];
    for (int n = 0; n < nHostAddrs; n++) {
      bindAddresses[n] = HostInterface.getHostAddress(n);
    }
  }
  for (int j = 0; j < bindAddresses.length; j++) {
    if (bindAddresses[j] == null || bindAddresses[j].length() == 0)
      continue;
    int ssdpCount = getSSDPAnnounceCount();
    for (int i = 0; i < ssdpCount; i++)
      announce(bindAddresses[j]);
  }
}

代码示例来源:origin: cybergarage/cybergarage-upnp

public void announce() {
  notifyWait();
  InetAddress[] binds = getDeviceData().getHTTPBindAddress();
  String[] bindAddresses;
  if (binds != null) {
    bindAddresses = new String[binds.length];
    for (int i = 0; i < binds.length; i++) {
      bindAddresses[i] = binds[i].getHostAddress();
    }
  } else {
    int nHostAddrs = HostInterface.getNHostAddresses();
    bindAddresses = new String[nHostAddrs];
    for (int n = 0; n < nHostAddrs; n++) {
      bindAddresses[n] = HostInterface.getHostAddress(n);
    }
  }
  for (int j = 0; j < bindAddresses.length; j++) {
    if (bindAddresses[j] == null || bindAddresses[j].length() == 0)
      continue;
    int ssdpCount = getSSDPAnnounceCount();
    for (int i = 0; i < ssdpCount; i++)
      announce(bindAddresses[j]);
  }
}

代码示例来源:origin: cybergarage/cybergarage-upnp

announce();

代码示例来源:origin: geniusgithub/MediaPlayer

announce();

代码示例来源:origin: cybergarage/cybergarage-upnp

for (int n = 0; n < childDeviceCnt; n++) {
  Device childDevice = childDeviceList.getDevice(n);
  childDevice.announce(bindAddr);

代码示例来源:origin: geniusgithub/MediaPlayer

for (int n = 0; n < childDeviceCnt; n++) {
  Device childDevice = childDeviceList.getDevice(n);
  childDevice.announce(bindAddr);

相关文章

Device类方法