net.i2p.client.streaming.impl

## Interface MessageOutputStream.WriteStatus

- All Known Implementing Classes:
    PacketLocal
  Enclosing class:
    MessageOutputStream

      public static interface MessageOutputStream.WriteStatus

  Interface to detect status of an asynchronous write operation.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `waitForAccept(int maxWaitMs)` Wait until data write is accepted into outbound queue, indicating space is available.
    `void` | `waitForCompletion(int maxWaitMs)` Wait until data write either succeeds or fails (ACK received).
    `boolean` | `writeAccepted()` Returns true if the write was accepted by the outbound queue.
    `boolean` | `writeFailed()` Returns true if the write operation failed.
    `boolean` | `writeSuccessful()` Returns true if the write operation succeeded.

- - ### Method Detail

    - #### waitForAccept

          void waitForAccept(int maxWaitMs)
                      throws IOException,
                             InterruptedException

      Wait until data write is accepted into outbound queue, indicating space is available.
      Parameters:
        `maxWaitMs` - maximum wait time in milliseconds (-1 means wait forever)
      Throws:
        `IOException` - if acceptance fails or times out
        `InterruptedException` - if waiting thread is interrupted

    - #### waitForCompletion

          void waitForCompletion(int maxWaitMs)
                          throws IOException,
                                 InterruptedException

      Wait until data write either succeeds or fails (ACK received).
      Parameters:
        `maxWaitMs` - maximum wait time in milliseconds (-1 means wait forever)
      Throws:
        `IOException` - if write fails or times out
        `InterruptedException` - if waiting thread is interrupted

    - #### writeAccepted

          boolean writeAccepted()

      Returns true if the write was accepted by the outbound queue.
      Returns:
        true if accepted, false otherwise

    - #### writeFailed

          boolean writeFailed()

      Returns true if the write operation failed.
      Returns:
        true if failed, false otherwise

    - #### writeSuccessful

          boolean writeSuccessful()

      Returns true if the write operation succeeded.
      Returns:
        true if successful, false otherwise