Examples of closeFuture()


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

            System.out.println("WebSocket Client sending close");
            ch.write(new CloseWebSocketFrame());

            // WebSocketClientHandler will close the connection when the server
            // responds to the CloseWebSocketFrame.
            ch.closeFuture().sync();
        } finally {
            b.shutdown();
        }
    }
View Full Code Here

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

                    new InetSocketAddress("255.255.255.255", port)));

            // QuoteOfTheMomentClientHandler will close the DatagramChannel when a
            // response is received.  If the channel is not closed within 5 seconds,
            // print an error message and quit.
            if (!ch.closeFuture().await(5000)) {
                System.err.println("QOTM request timed out.");
            }
        } finally {
            b.shutdown();
        }
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()

        }
        if (!removed) {
            return false;
        }

        c.closeFuture().removeListener(remover);
        return true;
    }

    @Override
    public void clear() {
View Full Code Here

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

      b.group(bossGroup, workerGroup)
        .channel(NioServerSocketChannel.class)
        .childHandler(new HttpSnoopServerInitializer(fw));

      Channel ch = b.bind(fw.host, fw.port).sync().channel();
      ch.closeFuture().sync();
    } finally {
      bossGroup.shutdownGracefully();
      workerGroup.shutdownGracefully();
    }
  }
View Full Code Here

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

            Channel ch = b.bind(PORT).sync().channel();

            System.err.println("Open your SPDY-enabled web browser and navigate to https://127.0.0.1:" + PORT + '/');
            System.err.println("If using Chrome browser, check your SPDY sessions at chrome://net-internals/#spdy");

            ch.closeFuture().sync();
        } finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }
    }
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()

        // 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
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.