File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
src/main/java/com/bhyoo/onedrive/client Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -67,18 +67,25 @@ public class RequestTool {
6767 static {
6868 EventLoopGroup tmpGroup ;
6969 Class <? extends SocketChannel > tmpClass ;
70- try {
71- ClassLoader classLoader = ClassLoader .getSystemClassLoader ();
70+ ClassLoader classLoader = ClassLoader .getSystemClassLoader ();
7271
72+ try {
7373 Class <?> loadClass = classLoader .loadClass ("io.netty.channel.epoll.EpollEventLoopGroup" );
7474 tmpGroup = (EventLoopGroup ) loadClass .getConstructor (int .class ).newInstance (4 );
7575 tmpClass = (Class <? extends SocketChannel >)
7676 classLoader .loadClass ("io.netty.channel.epoll.EpollSocketChannel" );
7777 }
7878 catch (Exception e ) {
79- e .printStackTrace ();
80- tmpGroup = new NioEventLoopGroup (4 );
81- tmpClass = NioSocketChannel .class ;
79+ try {
80+ Class <?> loadClass = classLoader .loadClass ("io.netty.channel.kqueue.KQueueEventLoopGroup" );
81+ tmpGroup = (EventLoopGroup ) loadClass .getConstructor (int .class ).newInstance (4 );
82+ tmpClass = (Class <? extends SocketChannel >)
83+ classLoader .loadClass ("io.netty.channel.kqueue.KQueueSocketChannel" );
84+ }
85+ catch (Exception e1 ) {
86+ tmpGroup = new NioEventLoopGroup (4 );
87+ tmpClass = NioSocketChannel .class ;
88+ }
8289 }
8390
8491 group = tmpGroup ;
You can’t perform that action at this time.
0 commit comments