@Override public void openAsync(final AsyncCompletionHandler<Void> handler) { initializeChannel(handler, new LinkedList<SocketAddress>(address.getSocketAddresses())); }
private SocketChannel initializeSocketChannel() throws IOException { Iterator<InetSocketAddress> inetSocketAddresses = address.getSocketAddresses().iterator(); while (inetSocketAddresses.hasNext()) { SocketChannel socketChannel = SocketChannel.open(); try { SocketStreamHelper.initialize(socketChannel.socket(), inetSocketAddresses.next(), settings, sslSettings); return socketChannel; } catch (SocketTimeoutException e) { if (!inetSocketAddresses.hasNext()) { throw e; } } } throw new MongoSocketException("Exception opening socket", getAddress()); }
private Socket initializeSocket() throws IOException { Iterator<InetSocketAddress> inetSocketAddresses = address.getSocketAddresses().iterator(); while (inetSocketAddresses.hasNext()) { Socket socket = socketFactory.createSocket(); try { SocketStreamHelper.initialize(socket, inetSocketAddresses.next(), settings, sslSettings); return socket; } catch (SocketTimeoutException e) { if (!inetSocketAddresses.hasNext()) { throw e; } } } throw new MongoSocketException("Exception opening socket", getAddress()); }
@Override public void openAsync(final AsyncCompletionHandler<Void> handler) { isTrue("unopened", getChannel() == null); initializeSocketChannel(handler, new LinkedList<SocketAddress>(serverAddress.getSocketAddresses())); }
@Override public void openAsync(final AsyncCompletionHandler<Void> handler) { initializeChannel(handler, new LinkedList<SocketAddress>(address.getSocketAddresses())); }
private SocketChannel initializeSocketChannel() throws IOException { Iterator<InetSocketAddress> inetSocketAddresses = address.getSocketAddresses().iterator(); while (inetSocketAddresses.hasNext()) { SocketChannel socketChannel = SocketChannel.open(); try { SocketStreamHelper.initialize(socketChannel.socket(), inetSocketAddresses.next(), settings, sslSettings); return socketChannel; } catch (SocketTimeoutException e) { if (!inetSocketAddresses.hasNext()) { throw e; } } } throw new MongoSocketException("Exception opening socket", getAddress()); }
private Socket initializeSocket() throws IOException { Iterator<InetSocketAddress> inetSocketAddresses = address.getSocketAddresses().iterator(); while (inetSocketAddresses.hasNext()) { Socket socket = socketFactory.createSocket(); try { SocketStreamHelper.initialize(socket, inetSocketAddresses.next(), settings, sslSettings); return socket; } catch (SocketTimeoutException e) { if (!inetSocketAddresses.hasNext()) { throw e; } } } throw new MongoSocketException("Exception opening socket", getAddress()); }
@Override public void openAsync(final AsyncCompletionHandler<Void> handler) { isTrue("unopened", getChannel() == null); initializeSocketChannel(handler, new LinkedList<SocketAddress>(serverAddress.getSocketAddresses())); }