@@ -0,0 +1,1468 @@
+/*%0A * Copyright (c) 2017 D3adspace%0A * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated%0A * documentation files (the %22Software%22), to deal in the Software without restriction, including without limitation the%0A * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit%0A * persons to whom the Software is furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the%0A * Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT%0A * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND%0A * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,%0A *  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.%0A *%0A */%0A%0Apackage de.d3adspace.reincarnation.commons.netty;%0A%0Aimport io.netty.buffer.Unpooled;%0Aimport io.netty.channel.Channel;%0Aimport io.netty.channel.ChannelFutureListener;%0A%0Apublic class ReincarnationNettyChannelUtils %7B%0A%09%0A%09public static void closeWhenFlushed(Channel channel) %7B%0A%09%09channel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);%0A%09%7D%0A%7D%0A

add utils to close channels on exceptions