Examples of closeFuture()


Examples of io.netty.channel.Channel.closeFuture()

      b.childOption(ChannelOption.ALLOCATOR, new PooledByteBufAllocator(true));
      b.childOption(ChannelOption.SO_REUSEADDR, true);
      b.childOption(ChannelOption.MAX_MESSAGES_PER_READ, Integer.MAX_VALUE);

      Channel ch = b.bind(port).sync().channel();
      ch.closeFuture().sync();
  } finally {
      loupGroup.shutdownGracefully().sync();
  }
    }
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

                    if (httpChannel != null) {
                        httpChannel.closeFuture().sync();
                    }
                    if (httpsChannel != null) {
                        httpsChannel.closeFuture().sync();
                    }
                } catch (InterruptedException ie) {
                    logger.error("MockServer receive InterruptedException", ie);
                } finally {
                    bossGroup.shutdownGracefully();
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

                };
            });
            ChannelFuture bindFuture = bootstrap.bind();
            bindFuture.sync();
            Channel channel = bindFuture.channel();
            ChannelFuture closeFuture = channel.closeFuture();
            //closeFuture.sync();
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

        if (acquired)
        {
            try
            {
                channel = doGetConnection();
                channel.closeFuture().removeListener(inAvailableCloseListener);
            }
            catch (ConnectionFailedException ex)
            {
                permits.release();
            }
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

        // send request
        List<Entry<String, String>> entries = headers.entries();
        channel.writeAndFlush(request);

        // Wait for the server to close the connection.
        channel.closeFuture().sync();

        return entries;
    }

    /**
 
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

        //
        // On standard program, it is clearly recommended to clean all files after each request
        // bodyRequestEncoder.cleanFiles();

        // Wait for the server to close the connection.
        channel.closeFuture().sync();
        return bodylist;
    }

    /**
     * Multipart example
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

        // Now no more use of file representation (and list of HttpData)
        bodyRequestEncoder.cleanFiles();

        // Wait for the server to close the connection.
        channel.closeFuture().sync();
    }

    // use to simulate a small TEXTAREA field in a form
    private static final String textArea = "short text";
    // use to simulate a big TEXTAREA field in a form
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

                String msg = console.readLine();
                if (msg == null) {
                    break;
                } else if ("bye".equals(msg.toLowerCase())) {
                    ch.writeAndFlush(new CloseWebSocketFrame());
                    ch.closeFuture().sync();
                    break;
                } else if ("ping".equals(msg.toLowerCase())) {
                    WebSocketFrame frame = new PingWebSocketFrame(Unpooled.wrappedBuffer(new byte[] { 8, 1, 8, 1 }));
                    ch.writeAndFlush(frame);
                } else {
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

             .childHandler(new WebSocketSslServerInitializer());

            Channel ch = b.bind(port).sync().channel();
            System.out.println("Web socket server started at port " + port + '.');
            System.out.println("Open your browser and navigate to https://localhost:" + port + '/');
            ch.closeFuture().sync();
        } finally {
            b.shutdown();
        }
    }
View Full Code Here

Examples of io.netty.channel.Channel.closeFuture()

                lastWriteFuture = ch.write(line + "\r\n");

                // If user typed the 'bye' command, wait until the server closes
                // the connection.
                if ("bye".equals(line.toLowerCase())) {
                    ch.closeFuture().sync();
                    break;
                }
            }

            // Wait until all messages are flushed before closing the channel.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.