本文整理了Java中com.mpush.tools.Utils.getInetAddress()
方法的一些代码示例,展示了Utils.getInetAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getInetAddress()
方法的具体详情如下:
包路径:com.mpush.tools.Utils
类名称: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());
}
内容来源于网络,如有侵权,请联系作者删除!