Package org.apache.sshd.common.io

Examples of org.apache.sshd.common.io.IoWriteFuture


    public IoWriteFuture writePacket(Buffer buffer) throws IOException {
        boolean rescheduleIdleTimer = getState() == State.Running;
        if (rescheduleIdleTimer) {
            unscheduleIdleTimer();
        }
        IoWriteFuture future = super.writePacket(buffer);
        if (rescheduleIdleTimer) {
            scheduleIdleTimer();
        }
        return future;
    }
View Full Code Here


            AbstractSession cs = (AbstractSession) session;
            Buffer buffer = cs.createBuffer(SshConstants.SSH_MSG_DISCONNECT);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            IoWriteFuture f = cs.writePacket(buffer);
            f.await();
            suspend(cs.getIoSession());

            TestEchoShellFactory.TestEchoShell.latch.await();
        } finally {
            TestEchoShellFactory.TestEchoShell.latch = null;
View Full Code Here

                    throw new IllegalArgumentException("exception");
                }
                setValue(exception);
            }
        }
        final IoWriteFuture future = new Future(null);
        session.write(MinaSupport.asIoBuffer(buffer)).addListener(new IoFutureListener<WriteFuture>() {
            public void operationComplete(WriteFuture cf) {
                if (cf.getException() != null) {
                    future.setException(cf.getException());
                } else {
                    future.setWritten();
                }
            }
        });
        return future;
    }
View Full Code Here

            AbstractSession cs = (AbstractSession) session;
            Buffer buffer = cs.createBuffer(SshConstants.SSH_MSG_DISCONNECT);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            IoWriteFuture f = cs.writePacket(buffer);
            f.await();
            suspend(cs.getIoSession());

            TestEchoShellFactory.TestEchoShell.latch.await();
        } finally {
            TestEchoShellFactory.TestEchoShell.latch = null;
View Full Code Here

                    throw new IllegalArgumentException("exception");
                }
                setValue(exception);
            }
        }
        final IoWriteFuture future = new Future(null);
        session.write(MinaSupport.asIoBuffer(buffer)).addListener(new IoFutureListener<WriteFuture>() {
            public void operationComplete(WriteFuture cf) {
                if (cf.getException() != null) {
                    future.setException(cf.getException());
                } else {
                    future.setWritten();
                }
            }
        });
        return future;
    }
View Full Code Here

            AbstractSession cs = (AbstractSession) session;
            Buffer buffer = cs.createBuffer(SshConstants.SSH_MSG_DISCONNECT);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            IoWriteFuture f = cs.writePacket(buffer);
            f.await();
            suspend(cs.getIoSession());

            TestEchoShellFactory.TestEchoShell.latch.await();
        } finally {
            TestEchoShellFactory.TestEchoShell.latch = null;
View Full Code Here

            AbstractSession cs = (AbstractSession) session;
            Buffer buffer = cs.createBuffer(SshConstants.Message.SSH_MSG_DISCONNECT, 0);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            IoWriteFuture f = cs.writePacket(buffer);
            f.await();
            suspend(cs.getIoSession());

            TestEchoShellFactory.TestEchoShell.latch.await();
        } finally {
            TestEchoShellFactory.TestEchoShell.latch = null;
View Full Code Here

TOP

Related Classes of org.apache.sshd.common.io.IoWriteFuture

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.