Examples of cause()


Examples of io.netty.channel.ChannelFuture.cause()

    }

    private ChannelFuture doBind(final SocketAddress localAddress) {
        final ChannelFuture regFuture = initAndRegister();
        final Channel channel = regFuture.channel();
        if (regFuture.cause() != null) {
            return regFuture;
        }

        if (regFuture.isDone()) {
            // At this point we know that the registration was complete and succesful.
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

            // as the Channel is not registered yet we need to force the usage of the GlobalEventExecutor
            return new DefaultChannelPromise(channel, GlobalEventExecutor.INSTANCE).setFailure(t);
        }

        ChannelFuture regFuture = group().register(channel);
        if (regFuture.cause() != null) {
            if (channel.isRegistered()) {
                channel.close();
            } else {
                channel.unsafe().closeForcibly();
            }
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

     */
    public boolean writeOutbound(Object data) {
        ensureOpen();
        ChannelFuture future = write(data);
        assert future.isDone();
        if (future.cause() != null) {
            recordException(future.cause());
        }
        runPendingTasks();
        checkException();
        return hasReadableOutboundBuffer();
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

    public boolean writeOutbound(Object data) {
        ensureOpen();
        ChannelFuture future = write(data);
        assert future.isDone();
        if (future.cause() != null) {
            recordException(future.cause());
        }
        runPendingTasks();
        checkException();
        return hasReadableOutboundBuffer();
    }
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

        // Wait until the connection attempt succeeds or fails.
        channel = future.awaitUninterruptibly().channel();
        if (!future.isSuccess())
        {
            bootstrap.group().shutdownGracefully();
            throw new IOException("Connection Error", future.cause());
        }
    }

    public void login(Map<String, String> credentials)
    {
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

        ByteBuf buf = channel.alloc().buffer();

        buf.writeInt(dataLength);
        buf.writeBytes(data, 0, dataLength);
        ChannelFuture channelFuture = channel.writeAndFlush(buf);
        if (channelFuture.cause() != null) {
          throw channelFuture.cause();
        }
      } catch (IOException ioe) {
        markClosed(ioe);
      } catch (Throwable t) {
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

        buf.writeInt(dataLength);
        buf.writeBytes(data, 0, dataLength);
        ChannelFuture channelFuture = channel.writeAndFlush(buf);
        if (channelFuture.cause() != null) {
          throw channelFuture.cause();
        }
      } catch (IOException ioe) {
        markClosed(ioe);
      } catch (Throwable t) {
        markClosed(new IOException(t));
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

        // Wait until the connection attempt succeeds or fails.
        channel = future.awaitUninterruptibly().channel();
        if (!future.isSuccess())
        {
            bootstrap.group().shutdownGracefully();
            throw new IOException("Connection Error", future.cause());
        }
    }

    public void login(Map<String, String> credentials)
    {
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

            int size = futures.size();
            for (int i = 0; i < size; i++) {
                ChannelFuture future = (ChannelFuture) futures.get(i);
                assert future.isDone();
                if (future.cause() != null) {
                    recordException(future.cause());
                }
            }

            runPendingTasks();
View Full Code Here

Examples of io.netty.channel.ChannelFuture.cause()

            int size = futures.size();
            for (int i = 0; i < size; i++) {
                ChannelFuture future = (ChannelFuture) futures.get(i);
                assert future.isDone();
                if (future.cause() != null) {
                    recordException(future.cause());
                }
            }

            runPendingTasks();
            checkException();
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.