Package net.gleamynode.netty.channel

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


        } finally {
            bufferPool.release(outNetBuf);
        }

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

                        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

        } finally {
            bufferPool.release(outNetBuf);
        }

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

TOP

Related Classes of net.gleamynode.netty.channel.SucceededChannelFuture

Copyright © 2018 www.massapicom. 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.