com.mpush.tools.Utils.getInetAddress()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(236)

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

Utils.getInetAddress介绍

[英]只获取第一块网卡绑定的ip地址
[中]只获取第一块网卡绑定的知识产权地址

代码示例

代码示例来源:origin: mpusher/mpush

public static String lookupLocalIp() {
  if (LOCAL_IP == null) {
    LOCAL_IP = getInetAddress(true);
  }
  return LOCAL_IP;
}

代码示例来源:origin: mpusher/mpush

public static String lookupExtranetIp() {
  if (EXTRANET_IP == null) {
    EXTRANET_IP = getInetAddress(false);
  }
  return EXTRANET_IP;
}

代码示例来源:origin: mpusher/mpush

@Override
public void init() {
  super.init();
  messageDispatcher.register(Command.OK, () -> new GatewayOKHandler(mPushClient));
  messageDispatcher.register(Command.ERROR, () -> new GatewayErrorHandler(mPushClient));
  channelHandler = new UDPChannelHandler(messageDispatcher);
  channelHandler.setMulticastAddress(Utils.getInetAddress(CC.mp.net.gateway_client_multicast));
  channelHandler.setNetworkInterface(Utils.getLocalNetworkInterface());
}

代码示例来源:origin: mpusher/mpush

@Override
public void init() {
  super.init();
  messageDispatcher.register(Command.GATEWAY_PUSH, () -> new GatewayPushHandler(mPushServer.getPushCenter()));
  messageDispatcher.register(Command.GATEWAY_KICK, () -> new GatewayKickUserHandler(mPushServer.getRouterCenter()));
  channelHandler.setMulticastAddress(Utils.getInetAddress(CC.mp.net.gateway_server_multicast));
  channelHandler.setNetworkInterface(Utils.getLocalNetworkInterface());
}

代码示例来源:origin: com.github.mpusher/mpush-tools

public static String lookupExtranetIp() {
  if (EXTRANET_IP == null) {
    EXTRANET_IP = getInetAddress(false);
  }
  return EXTRANET_IP;
}

代码示例来源:origin: com.github.mpusher/mpush-tools

public static String lookupLocalIp() {
  if (LOCAL_IP == null) {
    LOCAL_IP = getInetAddress(true);
  }
  return LOCAL_IP;
}

代码示例来源:origin: com.github.mpusher/mpush-client

@Override
public void init() {
  super.init();
  messageDispatcher.register(Command.OK, () -> new GatewayOKHandler(mPushClient));
  messageDispatcher.register(Command.ERROR, () -> new GatewayErrorHandler(mPushClient));
  channelHandler = new UDPChannelHandler(messageDispatcher);
  channelHandler.setMulticastAddress(Utils.getInetAddress(CC.mp.net.gateway_client_multicast));
  channelHandler.setNetworkInterface(Utils.getLocalNetworkInterface());
}

代码示例来源:origin: com.github.mpusher/mpush-core

@Override
public void init() {
  super.init();
  messageDispatcher.register(Command.GATEWAY_PUSH, () -> new GatewayPushHandler(mPushServer.getPushCenter()));
  messageDispatcher.register(Command.GATEWAY_KICK, () -> new GatewayKickUserHandler(mPushServer.getRouterCenter()));
  channelHandler.setMulticastAddress(Utils.getInetAddress(CC.mp.net.gateway_server_multicast));
  channelHandler.setNetworkInterface(Utils.getLocalNetworkInterface());
}

相关文章