Codota Logo
HostInfo.getInterface
Code IndexAdd Codota to your IDE (free)

How to use
getInterface
method
in
javax.jmdns.impl.HostInfo

Best Java code snippets using javax.jmdns.impl.HostInfo.getInterface (Showing top 8 results out of 315)

  • Common ways to obtain HostInfo
private void myMethod () {
HostInfo h =
  • Codota IconInetAddress address;JmDNSImpl jmDNSImpl;String jmdnsName;HostInfo.newHostInfo(address, jmDNSImpl, jmdnsName)
  • Codota IconInetAddress address;String name;JmDNSImpl dns;new HostInfo(address, name, dns)
  • Smart code suggestions by Codota
}
origin: org.jenkins-ci/jmdns

@Override
public String toString() {
  StringBuilder buf = new StringBuilder(1024);
  buf.append("local host info[");
  buf.append(getName() != null ? getName() : "no name");
  buf.append(", ");
  buf.append(getInterface() != null ? getInterface().getDisplayName() : "???");
  buf.append(":");
  buf.append(getInetAddress() != null ? getInetAddress().getHostAddress() : "no address");
  buf.append(", ");
  buf.append(_state);
  buf.append("]");
  return buf.toString();
}
origin: javax.jmdns/jmdns

@Override
public String toString() {
  StringBuilder buf = new StringBuilder(1024);
  buf.append("local host info[");
  buf.append(getName() != null ? getName() : "no name");
  buf.append(", ");
  buf.append(getInterface() != null ? getInterface().getDisplayName() : "???");
  buf.append(":");
  buf.append(getInetAddress() != null ? getInetAddress().getHostAddress() : "no address");
  buf.append(", ");
  buf.append(_state);
  buf.append("]");
  return buf.toString();
}
origin: org.jmdns/jmdns

@Override
public String toString() {
  final StringBuilder sb = new StringBuilder(1024);
  sb.append("local host info[");
  sb.append(getName() != null ? getName() : "no name");
  sb.append(", ");
  sb.append(getInterface() != null ? getInterface().getDisplayName() : "???");
  sb.append(":");
  sb.append(getInetAddress() != null ? getInetAddress().getHostAddress() : "no address");
  sb.append(", ");
  sb.append(_state);
  sb.append("]");
  return sb.toString();
}
origin: DeviceConnect/DeviceConnect-Android

@Override
public String toString() {
  StringBuilder buf = new StringBuilder(1024);
  buf.append("local host info[");
  buf.append(getName() != null ? getName() : "no name");
  buf.append(", ");
  buf.append(getInterface() != null ? getInterface().getDisplayName() : "???");
  buf.append(":");
  buf.append(getInetAddress() != null ? getInetAddress().getHostAddress() : "no address");
  buf.append(", ");
  buf.append(_state);
  buf.append("]");
  return buf.toString();
}
origin: org.jenkins-ci/jmdns

private void openMulticastSocket(HostInfo hostInfo) throws IOException {
  if (_group == null) {
    _group = InetAddress.getByName(DNSConstants.MDNS_GROUP);
  }
  if (_socket != null) {
    this.closeMulticastSocket();
  }
  _socket = new MulticastSocket(DNSConstants.MDNS_PORT);
  if ((hostInfo != null) && (hostInfo.getInterface() != null)) {
    try {
      _socket.setNetworkInterface(hostInfo.getInterface());
    } catch (SocketException e) {
      if (logger.isLoggable(Level.FINE)) {
        logger.fine("openMulticastSocket() Set network interface exception: " + e.getMessage());
      }
    }
  }
  _socket.setTimeToLive(255);
  _socket.joinGroup(_group);
}
origin: org.jmdns/jmdns

if ((hostInfo != null) && (hostInfo.getInterface() != null)) {
  final SocketAddress multicastAddr = new InetSocketAddress(_group, DNSConstants.MDNS_PORT);
  _socket.setNetworkInterface(hostInfo.getInterface());
  logger.trace("Trying to joinGroup({}, {})", multicastAddr, hostInfo.getInterface());
  _socket.joinGroup(multicastAddr, hostInfo.getInterface());
} else {
  logger.trace("Trying to joinGroup({})", _group);
origin: DeviceConnect/DeviceConnect-Android

private void openMulticastSocket(HostInfo hostInfo) throws IOException {
  Log.i("mDNS","openMulticastSocket");
  if (_group == null) {
    if (hostInfo.getInetAddress() instanceof Inet6Address) {
      _group = InetAddress.getByName(DNSConstants.MDNS_GROUP_IPV6);
    } else {
      _group = InetAddress.getByName(DNSConstants.MDNS_GROUP);
    }
  }
  if (_socket != null) {
    this.closeMulticastSocket();
  }
  _socket = new MulticastSocket(DNSConstants.MDNS_PORT);
  if ((hostInfo != null) && (hostInfo.getInterface() != null)) {
    try {
      _socket.setNetworkInterface(hostInfo.getInterface());
    } catch (SocketException e) {
      Log.i("mDNS","Error:"+e);
      if (logger.isLoggable(Level.FINE)) {
        logger.fine("openMulticastSocket() Set network interface exception: " + e.getMessage());
      }
    }
  }
  
  _socket.setTimeToLive(255);
  _socket.joinGroup(_group);
}
origin: javax.jmdns/jmdns

private void openMulticastSocket(HostInfo hostInfo) throws IOException {
  if (_group == null) {
    if (hostInfo.getInetAddress() instanceof Inet6Address) {
      _group = InetAddress.getByName(DNSConstants.MDNS_GROUP_IPV6);
    } else {
      _group = InetAddress.getByName(DNSConstants.MDNS_GROUP);
    }
  }
  if (_socket != null) {
    this.closeMulticastSocket();
  }
  _socket = new MulticastSocket(DNSConstants.MDNS_PORT);
  if ((hostInfo != null) && (hostInfo.getInterface() != null)) {
    try {
      _socket.setNetworkInterface(hostInfo.getInterface());
    } catch (SocketException e) {
      if (logger.isLoggable(Level.FINE)) {
        logger.fine("openMulticastSocket() Set network interface exception: " + e.getMessage());
      }
    }
  }
  _socket.setTimeToLive(255);
  _socket.joinGroup(_group);
}
javax.jmdns.implHostInfogetInterface

Popular methods of HostInfo

  • getInetAddress
  • getName
  • <init>
  • advanceState
  • answers
  • associateWithTask
  • cancelState
  • closeState
  • getDNS4AddressRecord
  • getDNS4ReverseAddressRecord
  • getDNS6AddressRecord
  • getDNS6ReverseAddressRecord
  • getDNS6AddressRecord,
  • getDNS6ReverseAddressRecord,
  • getDNSAddressRecord,
  • getDNSReverseAddressRecord,
  • getInet4Address,
  • getInet6Address,
  • incrementHostName,
  • isAnnounced,
  • isAnnouncing

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Path (java.nio.file)
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Reference (javax.naming)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now