Examples of closeFuture()


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()

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

            System.err.println("Open your HTTP/2-enabled web browser and navigate to " +
                    (SSL? "https" : "http") + "://127.0.0.1:" + PORT + '/');

            ch.closeFuture().sync();
        } finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }
    }
View Full Code Here

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

        if (c == null) {
            return false;
        }

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

    @Override
    public void clear() {
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()

            assertThat(registerResponse.getMessageType(), equalTo(MessageType.Type.REGISTER));
            assertThat(registerResponse.getChannelId(), equalTo(channelId));

            ch.writeAndFlush(new CloseWebSocketFrame());

            ch.closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }
View Full Code Here

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

            final String channelId = UUID.randomUUID().toString();
            final String register = JsonUtil.toJson(new RegisterMessageImpl(channelId));
            final ChannelFuture registerFuture = ch.writeAndFlush(new TextWebSocketFrame(register));
            registerFuture.sync();
            ch.writeAndFlush(new CloseWebSocketFrame());
            ch.closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }
View Full Code Here

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

                    .channel(NioServerSocketChannel.class)
                    .childHandler(new SockJSChannelInitializer(simplePushConfig, config.dataStore(), config.sockJsConfig(), reaperExcutorGroup));
            final Channel ch = sb.bind(simplePushConfig.host(), simplePushConfig.port()).sync().channel();
            logger.info("Server started");
            logger.debug(config.toString());
            ch.closeFuture().sync();
        } finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }
    }
View Full Code Here

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

                    closeService,
                    cookieNeededService);
            sb.group(bossGroup, workerGroup).childHandler(chInit);
            final Channel ch = sb.bind(port).sync().channel();
            System.out.println("Web socket server started on port [" + port + "], ");
            ch.closeFuture().sync();
        } finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }
    }
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.