Package org.apache.mina.core.future

Examples of org.apache.mina.core.future.WriteFuture.await()


  }
    }
   
    private static void send(IoSession session, Object object) throws InterruptedException, IOException {
  WriteFuture writeFuture = session.write(object);
  writeFuture.await(TIMEOUT);
  if (!writeFuture.isWritten()) {
      Throwable exception = writeFuture.getException();
      if(exception!=null){
    throw new IOException("Error occured while writing!", exception);
      }
View Full Code Here


            Buffer buffer = cs.createBuffer(SshConstants.Message.SSH_MSG_DISCONNECT, 0);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            WriteFuture f = cs.writePacket(buffer);
            f.await();
            cs.getIoSession().suspendRead();
            cs.getIoSession().suspendWrite();

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

            Buffer buffer = cs.createBuffer(SshConstants.Message.SSH_MSG_DISCONNECT, 0);
            buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
            buffer.putString("Cancel");
            buffer.putString("");
            WriteFuture f = cs.writePacket(buffer);
            f.await();
            cs.getIoSession().suspendRead();
            cs.getIoSession().suspendWrite();

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

    // Write the message and wait for it to be sent.
    WriteFuture future = session.write( message );
    LOG.debug( ">>>  return from session.write: {}  Waiting...", message_id );
    try {
      future.await();
    }
    catch( InterruptedException ex ) {
      throw new InterruptedIOException(
        "Interrupted while waiting for message write" );
    }
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.