com.hazelcast.nio.Address.getInetSocketAddress()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(129)

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

Address.getInetSocketAddress介绍

暂无

代码示例

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private boolean isLocalAddress(final Address address) throws UnknownHostException {
  2. final Address thisAddress = node.getThisAddress();
  3. final boolean local = thisAddress.getInetSocketAddress().equals(address.getInetSocketAddress());
  4. if (logger.isFineEnabled()) {
  5. logger.fine(address + " is local? " + local);
  6. }
  7. return local;
  8. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. private boolean isLocalAddress(final Address address) throws UnknownHostException {
  2. final Address thisAddress = node.getThisAddress();
  3. final boolean local = thisAddress.getInetSocketAddress().equals(address.getInetSocketAddress());
  4. if (logger.isFineEnabled()) {
  5. logger.fine(address + " is local? " + local);
  6. }
  7. return local;
  8. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. @Override
  2. public InetSocketAddress getSocketAddress() {
  3. try {
  4. return address.getInetSocketAddress();
  5. } catch (UnknownHostException e) {
  6. if (getLogger() != null) {
  7. getLogger().warning(e);
  8. }
  9. return null;
  10. }
  11. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. @Override
  2. public InetSocketAddress getSocketAddress() {
  3. try {
  4. return address.getInetSocketAddress();
  5. } catch (UnknownHostException e) {
  6. if (getLogger() != null) {
  7. getLogger().warning(e);
  8. }
  9. return null;
  10. }
  11. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. protected ClientConnection createSocketConnection(final Address remoteAddress) throws IOException {
  2. SocketChannel socketChannel = null;
  3. try {
  4. socketChannel = SocketChannel.open();
  5. Socket socket = socketChannel.socket();
  6. bindSocketToPort(socket);
  7. Channel channel = networking.register(socketChannel, true);
  8. channel.connect(remoteAddress.getInetSocketAddress(), connectionTimeoutMillis);
  9. ClientConnection connection
  10. = new ClientConnection(client, connectionIdGen.incrementAndGet(), channel);
  11. socketChannel.configureBlocking(true);
  12. if (socketInterceptor != null) {
  13. socketInterceptor.onConnect(socket);
  14. }
  15. channel.start();
  16. return connection;
  17. } catch (Exception e) {
  18. closeResource(socketChannel);
  19. throw rethrow(e, IOException.class);
  20. }
  21. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. if (address.isIPv4()) {
  2. tryToConnect(address.getInetSocketAddress(),
  3. ioService.getSocketConnectTimeoutSeconds() * MILLIS_PER_SECOND);
  4. } else if (thisAddress.isIPv6() && thisAddress.getScopeId() != null) {

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. if (address.isIPv4()) {
  2. tryToConnect(address.getInetSocketAddress(),
  3. ioService.getSocketConnectTimeoutSeconds() * MILLIS_PER_SECOND);
  4. } else if (thisAddress.isIPv6() && thisAddress.getScopeId() != null) {

相关文章