Examples of SucceededChannelFuture


Examples of net.gleamynode.netty.channel.SucceededChannelFuture

                        outNetBuf.clear();

                        if (pendingWrite.outAppBuf.hasRemaining()) {
                            // pendingWrite's future shouldn't be notified if
                            // only partial data is written.
                            future = new SucceededChannelFuture(channel);
                        } else {
                            future = pendingWrite.future;
                        }

                        MessageEvent encryptedWrite =
                            new DefaultMessageEvent(channel, future, msg, null);

                        if (Thread.holdsLock(pendingEncryptedWrites)) {
                            pendingEncryptedWrites.offer(encryptedWrite);
                        } else {
                            synchronized (pendingEncryptedWrites) {
                                pendingEncryptedWrites.offer(encryptedWrite);
                            }
                        }
                    } else {
                        switch (result.getHandshakeStatus()) {
                        case NEED_WRAP:
                            if (outAppBuf.hasRemaining()) {
                                break;
                            } else {
                                break loop;
                            }
                        case NEED_UNWRAP:
                            break loop;
                        case NEED_TASK:
                            runDelegatedTasks();
                            break;
                        case FINISHED:
                            setHandshakeSuccess();
                        default:
                            break loop;
                        }
                    }
                }
            }
        } catch (SSLException e) {
            if (handshaking) {
                setHandshakeFailure(e);
            }
            throw e;
        } finally {
            bufferPool.release(outNetBuf);
        }

        flushPendingEncryptedWrites(context);

        if (future == null) {
            future = new SucceededChannelFuture(channel);
        }
        return future;
    }
View Full Code Here

Examples of net.gleamynode.netty.channel.SucceededChannelFuture

        } finally {
            bufferPool.release(outNetBuf);
        }

        if (future == null) {
            future = new SucceededChannelFuture(channel);
        }
        return future;
    }
View Full Code Here

Examples of net.gleamynode.netty.channel.SucceededChannelFuture

                        outNetBuf.clear();

                        if (pendingWrite.outAppBuf.hasRemaining()) {
                            // pendingWrite's future shouldn't be notified if
                            // only partial data is written.
                            future = new SucceededChannelFuture(channel);
                        } else {
                            future = pendingWrite.future;
                        }

                        MessageEvent encryptedWrite =
                            new DefaultMessageEvent(channel, future, msg, null);

                        if (Thread.holdsLock(pendingEncryptedWrites)) {
                            pendingEncryptedWrites.offer(encryptedWrite);
                        } else {
                            synchronized (pendingEncryptedWrites) {
                                pendingEncryptedWrites.offer(encryptedWrite);
                            }
                        }
                    } else {
                        switch (result.getHandshakeStatus()) {
                        case NEED_WRAP:
                            if (outAppBuf.hasRemaining()) {
                                break;
                            } else {
                                break loop;
                            }
                        case NEED_UNWRAP:
                            break loop;
                        case NEED_TASK:
                            runDelegatedTasks();
                            break;
                        case FINISHED:
                            setHandshakeSuccess();
                        default:
                            break loop;
                        }
                    }
                }
            }
        } catch (SSLException e) {
            if (handshaking) {
                setHandshakeFailure(e);
            }
            throw e;
        } finally {
            bufferPool.release(outNetBuf);
        }

        flushPendingEncryptedWrites(context);

        if (future == null) {
            future = new SucceededChannelFuture(channel);
        }
        return future;
    }
View Full Code Here

Examples of net.gleamynode.netty.channel.SucceededChannelFuture

        } finally {
            bufferPool.release(outNetBuf);
        }

        if (future == null) {
            future = new SucceededChannelFuture(channel);
        }
        return future;
    }
View Full Code Here

Examples of org.jboss.netty.channel.SucceededChannelFuture

            // really fire and forget. You wont get an PortUnreachableException
            // if no one is listen on the port
            if (!configuration.isUdpConnectionlessSending()) {
                answer = connectionlessClientBootstrap.connect(new InetSocketAddress(configuration.getHost(), configuration.getPort()));
            } else {
                answer = new SucceededChannelFuture(channel);
            }
           
            if (LOG.isDebugEnabled()) {
                LOG.debug("Created new UDP client bootstrap connecting to {}:{} with options: {}",
                       new Object[]{configuration.getHost(), configuration.getPort(), connectionlessClientBootstrap.getOptions()});
View Full Code Here

Examples of org.jboss.netty.channel.SucceededChannelFuture

    @Override
    public ChannelFuture close() {
        closed = true;
        closingFuture.setSuccess();
        return new SucceededChannelFuture(this);
    }
View Full Code Here

Examples of org.jboss.netty.channel.SucceededChannelFuture

    }

    @Override
    public ChannelFuture write(Object message) {
        messagesWritten.add(message);
        return new SucceededChannelFuture(this);
    }
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.