fa6a8cb09c
Motivation: The SSLEngine does provide a way to signal to the caller that it may need to execute a blocking / long-running task which then can be offloaded to an Executor to ensure the I/O thread is not blocked. Currently how we handle this in SslHandler is not really optimal as while we offload to the Executor we still block the I/O Thread. Modifications: - Correctly support offloading the task to the Executor while suspending processing of SSL in the I/O Thread - Add new methods to SslContext to specify the Executor when creating a SslHandler - Remove @deprecated annotations from SslHandler constructor that takes an Executor - Adjust tests to also run with the Executor to ensure all works as expected. Result: Be able to offload long running tasks to an Executor when using SslHandler. Partly fixes https://github.com/netty/netty/issues/7862 and https://github.com/netty/netty/issues/7020.
43 lines
1.5 KiB
Java
43 lines
1.5 KiB
Java
/*
|
|
* Copyright 2015 The Netty Project
|
|
*
|
|
* The Netty Project licenses this file to you under the Apache License,
|
|
* version 2.0 (the "License"); you may not use this file except in compliance
|
|
* with the License. You may obtain a copy of the License at:
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
* License for the specific language governing permissions and limitations
|
|
* under the License.
|
|
*/
|
|
package io.netty.channel.epoll;
|
|
|
|
import io.netty.bootstrap.Bootstrap;
|
|
import io.netty.bootstrap.ServerBootstrap;
|
|
import io.netty.handler.ssl.SslContext;
|
|
import io.netty.testsuite.transport.TestsuitePermutation;
|
|
import io.netty.testsuite.transport.socket.SocketSslGreetingTest;
|
|
|
|
import java.net.SocketAddress;
|
|
import java.util.List;
|
|
|
|
public class EpollDomainSocketSslGreetingTest extends SocketSslGreetingTest {
|
|
|
|
public EpollDomainSocketSslGreetingTest(SslContext serverCtx, SslContext clientCtx, boolean delegate) {
|
|
super(serverCtx, clientCtx, delegate);
|
|
}
|
|
|
|
@Override
|
|
protected SocketAddress newSocketAddress() {
|
|
return EpollSocketTestPermutation.newSocketAddress();
|
|
}
|
|
|
|
@Override
|
|
protected List<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>> newFactories() {
|
|
return EpollSocketTestPermutation.INSTANCE.domainSocket();
|
|
}
|
|
}
|