@@ -0,0 +1,2754 @@
+/*%0A * Copyright 2012 The Netty Project%0A *%0A * The Netty Project licenses this file to you under the Apache License,%0A * version 2.0 (the %22License%22); you may not use this file except in compliance%0A * with the License. You may obtain a copy of the License at:%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage io.netty.example.applet;%0A%0Aimport io.netty.bootstrap.ServerBootstrap;%0Aimport io.netty.buffer.ByteBuf;%0Aimport io.netty.channel.ChannelFuture;%0Aimport io.netty.channel.ChannelHandlerContext;%0Aimport io.netty.channel.ChannelInboundByteHandlerAdapter;%0Aimport io.netty.channel.ChannelInitializer;%0Aimport io.netty.channel.socket.SocketChannel;%0Aimport io.netty.channel.socket.nio.NioEventLoopGroup;%0Aimport io.netty.channel.socket.nio.NioServerSocketChannel;%0Aimport io.netty.util.CharsetUtil;%0A%0Aimport javax.swing.JApplet;%0A%0A/**%0A * %7B@link JApplet%7D which starts up a Server that receive data and discard it.%0A */%0Apublic class AppletDiscardServer extends JApplet %7B%0A    private ServerBootstrap bootstrap;%0A    @Override%0A    public void init() %7B%0A        try %7B%0A            bootstrap = new ServerBootstrap();%0A            bootstrap.group(new NioEventLoopGroup(), new NioEventLoopGroup()).channel(NioServerSocketChannel.class)%0A                    .localAddress(9999).childHandler(new ChannelInitializer%3CSocketChannel%3E() %7B%0A                @Override%0A                public void initChannel(SocketChannel ch) throws Exception %7B%0A                    ch.pipeline().addLast(new DiscardServerHandler());%0A                %7D%0A            %7D);%0A            ChannelFuture f = bootstrap.bind().sync();%0A            f.channel().closeFuture().sync();%0A        %7D catch (Exception ex) %7B%0A            ex.printStackTrace();%0A            throw new RuntimeException(ex);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void destroy() %7B%0A        super.destroy();%0A        if (bootstrap != null) %7B%0A            bootstrap.shutdown();%0A        %7D%0A    %7D%0A%0A    private static final class DiscardServerHandler extends ChannelInboundByteHandlerAdapter %7B%0A%0A        @Override%0A        public void inboundBufferUpdated(ChannelHandlerContext ctx, ByteBuf in) throws Exception %7B%0A            System.out.println(%22Received: %22 + in.toString(CharsetUtil.UTF_8));%0A            in.clear();%0A        %7D%0A%0A        @Override%0A        public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception %7B%0A            cause.printStackTrace();%0A            ctx.close();%0A        %7D%0A    %7D%0A%7D%0A

Add example which start a server in a applet to show there is no issue anymore. Related to [#689]