mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-02-14 19:42:24 +01:00
Mark connectionHandler as sharable (#1179)
Fixes #1170. The reasoning for this PR is largely outlined in the above issue. As the ChannelInboundHandlerAdapter has no private class, a race condition cannot occur and therefore marking the class as sharable should incur no cost.
This commit is contained in:
parent
72c1f3e26c
commit
5acdb2b3c5
@ -186,6 +186,12 @@ public class ProtocolInjector implements ChannelListener {
|
||||
channel.pipeline().addFirst(beginInitProtocol);
|
||||
ctx.fireChannelRead(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSharable() {
|
||||
// Needed if multiple objects are stored in the bootstrap list
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
FuzzyReflection fuzzy = FuzzyReflection.fromObject(serverConnection, true);
|
||||
|
Loading…
Reference in New Issue
Block a user