Skip to content

Commit

Permalink
Remove netty5 Unsafe class (#2338)
Browse files Browse the repository at this point in the history
 Remove usage of Usafe (see netty/netty#12511).
  • Loading branch information
pderop committed Jun 28, 2022
1 parent d621dfc commit 957e2d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Expand Up @@ -437,7 +437,7 @@ void initChild(final Channel child) {
}

static void forceClose(Channel child, Throwable t) {
child.unsafe().closeForcibly();
child.close();
log.warn(format(child, "Failed to register an accepted channel: {}"), child, t);
}
}
Expand Down
Expand Up @@ -323,14 +323,14 @@ static Mono<Channel> doInitAndRegister(
channel.close();
}
else {
channel.unsafe().closeForcibly();
channel.close();
}
monoChannelPromise.setFailure(f.cause());
}
});
}
else {
channel.unsafe().closeForcibly();
channel.close();
monoChannelPromise.setFailure(future.cause());
}
});
Expand Down
Expand Up @@ -22,6 +22,7 @@
import io.netty5.channel.ChannelOutboundBuffer;
import io.netty5.channel.ChannelShutdownDirection;
import io.netty5.channel.embedded.EmbeddedChannel;
import io.netty5.util.concurrent.Promise;
import org.junit.jupiter.api.Test;
import reactor.util.annotation.Nullable;

Expand Down Expand Up @@ -123,11 +124,6 @@ static class TestChannel extends AbstractChannel {
this.remoteAddress = remoteAddress;
}

@Override
protected AbstractUnsafe newUnsafe() {
return null;
}

@Override
public SocketAddress localAddress() {
return localAddress0();
Expand Down Expand Up @@ -172,6 +168,10 @@ protected void doBeginRead() {
protected void doWrite(ChannelOutboundBuffer in) {
}

@Override
protected void connectTransport(SocketAddress remoteAddress, SocketAddress localAddress, Promise<Void> promise) {
}

@Override
public ChannelConfig config() {
return null;
Expand Down

0 comments on commit 957e2d8

Please sign in to comment.