|
22 | 22 | import io.netty.channel.ChannelHandlerContext;
|
23 | 23 | import io.netty.channel.ChannelOption;
|
24 | 24 | import io.netty.channel.ChannelPipeline;
|
25 |
| -import io.netty.channel.EventLoopGroup; |
26 |
| -import io.netty.channel.epoll.Epoll; |
27 | 25 | import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
|
28 | 26 | import io.netty.handler.logging.LogLevel;
|
29 | 27 | import io.netty.handler.logging.LoggingHandler;
|
@@ -379,7 +377,7 @@ public static Mono<ReactorNettyClient> connect(ConnectionProvider connectionProv
|
379 | 377 | TcpClient tcpClient = TcpClient.create(connectionProvider).remoteAddress(() -> socketAddress);
|
380 | 378 |
|
381 | 379 | if (!(socketAddress instanceof InetSocketAddress)) {
|
382 |
| - tcpClient = tcpClient.runOn(new SocketLoopResources(connectionSettings.hasLoopResources() ? connectionSettings.getRequiredLoopResources() : TcpResources.get()), true); |
| 380 | + tcpClient = tcpClient.runOn(connectionSettings.hasLoopResources() ? connectionSettings.getRequiredLoopResources() : TcpResources.get(), true); |
383 | 381 | } else {
|
384 | 382 |
|
385 | 383 | if (connectionSettings.hasLoopResources()) {
|
@@ -574,100 +572,6 @@ public ResponseQueueException(String message) {
|
574 | 572 |
|
575 | 573 | }
|
576 | 574 |
|
577 |
| - @SuppressWarnings({"deprecation"}) |
578 |
| - static class SocketLoopResources implements LoopResources { |
579 |
| - |
580 |
| - @Nullable |
581 |
| - private static final Class<? extends Channel> EPOLL_SOCKET = findClass("io.netty.channel.epoll.EpollDomainSocketChannel"); |
582 |
| - |
583 |
| - @Nullable |
584 |
| - private static final Class<? extends Channel> KQUEUE_SOCKET = findClass("io.netty.channel.kqueue.KQueueDomainSocketChannel"); |
585 |
| - |
586 |
| - private static final boolean kqueue; |
587 |
| - |
588 |
| - static { |
589 |
| - boolean kqueueCheck = false; |
590 |
| - try { |
591 |
| - Class.forName("io.netty.channel.kqueue.KQueue"); |
592 |
| - kqueueCheck = io.netty.channel.kqueue.KQueue.isAvailable(); |
593 |
| - } catch (ClassNotFoundException cnfe) { |
594 |
| - } |
595 |
| - kqueue = kqueueCheck; |
596 |
| - } |
597 |
| - |
598 |
| - private static final boolean epoll; |
599 |
| - |
600 |
| - static { |
601 |
| - boolean epollCheck = false; |
602 |
| - try { |
603 |
| - Class.forName("io.netty.channel.epoll.Epoll"); |
604 |
| - epollCheck = Epoll.isAvailable(); |
605 |
| - } catch (ClassNotFoundException cnfe) { |
606 |
| - } |
607 |
| - epoll = epollCheck; |
608 |
| - } |
609 |
| - |
610 |
| - private final LoopResources delegate; |
611 |
| - |
612 |
| - public SocketLoopResources(LoopResources delegate) { |
613 |
| - this.delegate = delegate; |
614 |
| - } |
615 |
| - |
616 |
| - @SuppressWarnings("unchecked") |
617 |
| - private static Class<? extends Channel> findClass(String className) { |
618 |
| - try { |
619 |
| - return (Class<? extends Channel>) SocketLoopResources.class.getClassLoader().loadClass(className); |
620 |
| - } catch (ClassNotFoundException e) { |
621 |
| - return null; |
622 |
| - } |
623 |
| - } |
624 |
| - |
625 |
| - @Override |
626 |
| - public Class<? extends Channel> onChannel(EventLoopGroup group) { |
627 |
| - |
628 |
| - if (epoll && EPOLL_SOCKET != null) { |
629 |
| - return EPOLL_SOCKET; |
630 |
| - } |
631 |
| - |
632 |
| - if (kqueue && KQUEUE_SOCKET != null) { |
633 |
| - return KQUEUE_SOCKET; |
634 |
| - } |
635 |
| - |
636 |
| - return this.delegate.onChannel(group); |
637 |
| - } |
638 |
| - |
639 |
| - @Override |
640 |
| - public EventLoopGroup onClient(boolean useNative) { |
641 |
| - return this.delegate.onClient(useNative); |
642 |
| - } |
643 |
| - |
644 |
| - @Override |
645 |
| - public EventLoopGroup onServer(boolean useNative) { |
646 |
| - return this.delegate.onServer(useNative); |
647 |
| - } |
648 |
| - |
649 |
| - @Override |
650 |
| - public EventLoopGroup onServerSelect(boolean useNative) { |
651 |
| - return this.delegate.onServerSelect(useNative); |
652 |
| - } |
653 |
| - |
654 |
| - @Override |
655 |
| - public boolean daemon() { |
656 |
| - return this.delegate.daemon(); |
657 |
| - } |
658 |
| - |
659 |
| - @Override |
660 |
| - public void dispose() { |
661 |
| - this.delegate.dispose(); |
662 |
| - } |
663 |
| - |
664 |
| - @Override |
665 |
| - public Mono<Void> disposeLater() { |
666 |
| - return this.delegate.disposeLater(); |
667 |
| - } |
668 |
| - |
669 |
| - } |
670 |
| - |
671 | 575 | /**
|
672 | 576 | * Value object representing a single conversation. The driver permits a single conversation at a time to ensure that request messages get routed to the proper response receiver and do not leak
|
673 | 577 | * into other conversations. A conversation must be finished in the sense that the {@link Publisher} of {@link FrontendMessage} has completed before the next conversation is started.
|
|
0 commit comments