Tabnine Logo
NetUtils.canTcpListen
Code IndexAdd Tabnine to your IDE (free)

How to use
canTcpListen
method
in
org.apache.servicecomb.foundation.common.net.NetUtils

Best Java code snippets using org.apache.servicecomb.foundation.common.net.NetUtils.canTcpListen (Showing top 3 results out of 315)

origin: apache/servicecomb-java-chassis

public static boolean canPublishEndpoint(String listenAddress) {
 if (StringUtils.isEmpty(listenAddress)) {
  LOGGER.info("listenAddress is null, can not publish.");
  return false;
 }
 IpPort ipPort = NetUtils.parseIpPortFromURI("http://" + listenAddress);
 if (ipPort == null) {
  LOGGER.info("invalid listenAddress {}, can not publish, format should be ip:port.", listenAddress);
  return false;
 }
 if (NetUtils.canTcpListen(ipPort.getSocketAddress().getAddress(), ipPort.getPort())) {
  LOGGER.info("{} is not listened, can not publish.", ipPort.getSocketAddress());
  return false;
 }
 return true;
}
origin: apache/servicecomb-java-chassis

@Override
public boolean canInit() {
 setListenAddressWithoutSchema(TransportConfig.getAddress());
 URIEndpointObject ep = (URIEndpointObject) getEndpoint().getAddress();
 if (ep == null) {
  return true;
 }
 if (!NetUtils.canTcpListen(ep.getSocketAddress().getAddress(), ep.getPort())) {
  LOGGER.warn(
    "Can not start VertxRestTransport, the port:{} may have been occupied. You can ignore this message if you are using a web container like tomcat.",
    ep.getPort());
  return false;
 }
 return true;
}
origin: org.apache.servicecomb/transport-rest-vertx

@Override
public boolean canInit() {
 setListenAddressWithoutSchema(TransportConfig.getAddress());
 URIEndpointObject ep = (URIEndpointObject) getEndpoint().getAddress();
 if (ep == null) {
  return true;
 }
 if (!NetUtils.canTcpListen(ep.getSocketAddress().getAddress(), ep.getPort())) {
  LOGGER.warn(
    "Can not start VertxRestTransport, the port:{} may have been occupied. You can ignore this message if you are using a web container like tomcat.",
    ep.getPort());
  return false;
 }
 return true;
}
org.apache.servicecomb.foundation.common.netNetUtilscanTcpListen

Popular methods of NetUtils

  • parseIpPortFromURI
  • parseIpPort
  • doGetHostNameAndHostAddress
  • doGetIpv4AddressFromNetworkInterface
    docker环境中,有时无法通过InetAddress.getLocalHost()获取 ,会报unknown host Exception, system error 此时,通过遍历网卡接口的方式规
  • ensureGetInterfaceAddress
  • getHostAddress
  • getHostName
  • getRealListenAddress
    对于配置为0.0.0.0的地址,let it go schema, e.g. http adddress, e.g 0.0.0.0:8080 return 实际监听的地址
  • humanReadableBytes

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now