Archiviert
13
0

Only suppress ClosedChannelExceptions

Dieser Commit ist enthalten in:
Dan Mulloy 2015-07-18 21:07:41 -04:00
Ursprung 900b31e0c9
Commit ae47ae3b89
2 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -243,6 +243,12 @@
</developers>
<dependencies>
<!-- This is for the JavaDocs
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.0.28.Final</version>
</dependency> -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>

Datei anzeigen

@ -284,13 +284,11 @@ public class NettyChannelInjector extends ByteToMessageDecoder implements Channe
ChannelHandlerAdapter exceptionHandler = new ChannelHandlerAdapter() {
@Override
public void exceptionCaught(ChannelHandlerContext context, Throwable ex) throws Exception {
if (ex instanceof ClosedChannelException) {
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (cause instanceof ClosedChannelException) {
// Ignore
} else {
// TODO Actually handle exceptions?
System.err.println("[ProtocolLib] Encountered an uncaught exception in the channel pipeline:");
ex.printStackTrace();
super.exceptionCaught(ctx, cause);
}
}
};
@ -821,7 +819,7 @@ public class NettyChannelInjector extends ByteToMessageDecoder implements Channe
// we end up with a deadlock. The main thread is waiting for the worker thread to process the task, and
// the worker thread is waiting for the main thread to finish executing PlayerQuitEvent.
//
// TLDR: Concurrency is hard.
// TL;DR: Concurrency is hard.
executeInChannelThread(new Runnable() {
@Override
public void run() {