Examples of WriteFuture


Examples of org.apache.mina.common.WriteFuture

    public WriteFuture write(Object message, SocketAddress remoteAddress) {
        if (isClosing() ) {
            return DefaultWriteFuture.newNotWrittenFuture(this);
        }

        WriteFuture future = new DefaultWriteFuture(this);
        write0(new WriteRequest(message, future, remoteAddress));

        return future;
    }
View Full Code Here

Examples of org.apache.mina.common.WriteFuture

        bufferQueue.offer(newBuf);
    }

    public WriteFuture flush() {
        Queue<ByteBuffer> bufferQueue = this.bufferQueue;
        WriteFuture future = null;
        if (bufferQueue.isEmpty()) {
            return null;
        } else {
            for (;;) {
                ByteBuffer buf = bufferQueue.poll();
View Full Code Here

Examples of org.apache.mina.common.WriteFuture

            ByteBuffer byteBuffer = getNextByteBuffer(inputStream);

            if (byteBuffer == null) {
                // End of stream reached.
                session.removeAttribute(CURRENT_STREAM);
                WriteFuture writeFuture = (WriteFuture) session
                        .removeAttribute(INITIAL_WRITE_FUTURE);

                // Write queued WriteRequests.
                Queue<? extends WriteRequest> queue = (Queue<? extends WriteRequest>) session
                        .removeAttribute(WRITE_REQUEST_QUEUE);
                if (queue != null) {
                    WriteRequest wr = queue.poll();
                    while (wr != null) {
                        filterWrite(nextFilter, session, wr);
                        wr = queue.poll();
                    }
                }

                writeFuture.setWritten(true);
                nextFilter.messageSent(session, inputStream);
            } else {
                nextFilter.filterWrite(session, new WriteRequest(byteBuffer));
            }
        }
View Full Code Here

Examples of org.apache.mina.common.WriteFuture

            this.writeRequest = writeRequest;
        }

        @Override
        protected WriteFuture doFlush(ByteBuffer buf) {
            WriteFuture future = new DefaultWriteFuture(session);
            nextFilter.filterWrite(session, new WriteRequest(
                    new HiddenByteBuffer(buf), future, writeRequest
                            .getDestination()));
            return future;
        }
View Full Code Here

Examples of org.apache.mina.common.WriteFuture

        // set flag that we are writing encrypted data
        // (used in SSLFilter.filterWrite())
        writingEncryptedData = true;

        // write net data
        WriteFuture writeFuture = null;

        try {
            if (SessionLog.isDebugEnabled(session)) {
                SessionLog.debug(session, " write outNetBuffer: "
                        + getOutNetBuffer());
View Full Code Here

Examples of org.apache.mina.common.WriteFuture

     * @throws IllegalArgumentException if this filter is not managing the specified session
     */
    public WriteFuture stopSSL(IoSession session) throws SSLException {
        SSLHandler handler = getSSLSessionHandler(session);
        NextFilter nextFilter = (NextFilter) session.getAttribute(NEXT_FILTER);
        WriteFuture future;
        synchronized (handler) {
            future = initiateClosure(nextFilter, session);
        }

        handler.flushScheduledEvents();
View Full Code Here

Examples of org.apache.mina.common.WriteFuture

            // SSL might have not started yet.
            nextFilter.filterClose(session);
            return;
        }

        WriteFuture future = null;
        try {
            synchronized (handler) {
                if (isSSLStarted(session)) {
                    future = initiateClosure(nextFilter, session);
                    future.addListener(new IoFutureListener() {
                        public void operationComplete(IoFuture future) {
                            nextFilter.filterClose(session);
                        }
                    });
                }
View Full Code Here

Examples of org.apache.mina.common.WriteFuture

        if (!handler.closeOutbound()) {
            return DefaultWriteFuture.newNotWrittenFuture(session);
        }

        // there might be data to write out here?
        WriteFuture future = handler.writeNetBuffer(nextFilter);

        if (handler.isInboundDone()) {
            handler.destroy();
        }
View Full Code Here

Examples of org.apache.mina.core.future.WriteFuture

    /**
     * @see IoSession#write(Object)
     */
    public WriteFuture write(Object message) {
  WriteFuture future = wrappedSession.write(message);
  this.lastReply = (FtpReply) message;
  return future;
    }
View Full Code Here

Examples of org.apache.mina.core.future.WriteFuture

    /**
     * @see IoSession#write(Object, SocketAddress)
     */
    public WriteFuture write(Object message, SocketAddress destination) {
  WriteFuture future = wrappedSession.write(message, destination);
  this.lastReply = (FtpReply) message;
  return future;
    }
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.