io.vertx.core.datagram

## Interface PacketWritestream

- All Superinterfaces:
    StreamBase, WriteStream<Buffer>

      public interface PacketWritestream
      extends WriteStream<Buffer>

  A `WriteStream` for sending packets to a `SocketAddress`. The stream `WriteStream.exceptionHandler(io.vertx.core.Handler<java.lang.Throwable>)` is called when the write fails.
  Author:
    Julien Viet

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `PacketWritestream` | `drainHandler(Handler<Void> handler)` Set a drain handler on the stream.
    `PacketWritestream` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the write stream.
    `PacketWritestream` | `setWriteQueueMaxSize(int maxSize)` Set the maximum size of the write queue to `maxSize`.
    `PacketWritestream` | `write(Buffer data)` Write some data to the stream.

    - ### Methods inherited from interface io.vertx.core.streams.WriteStream

      `writeQueueFull`

- - ### Method Detail

    - #### exceptionHandler

          PacketWritestream exceptionHandler(Handler<Throwable> handler)

      Description copied from interface: `WriteStream`
      Set an exception handler on the write stream.
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Specified by:
        `exceptionHandler` in interface `WriteStream<Buffer>`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### write

          PacketWritestream write(Buffer data)

      Description copied from interface: `WriteStream`
      Write some data to the stream. The data is put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the `WriteStream.writeQueueFull()` method before writing. This is done automatically if using a `Pump`.
      Specified by:
        `write` in interface `WriteStream<Buffer>`
      Parameters:
        `data` - the data to write
      Returns:
        a reference to this, so the API can be used fluently

    - #### setWriteQueueMaxSize

          PacketWritestream setWriteQueueMaxSize(int maxSize)

      Description copied from interface: `WriteStream`
      Set the maximum size of the write queue to `maxSize`. You will still be able to write to the stream even if there is more than `maxSize` bytes in the write queue. This is used as an indicator by classes such as `Pump` to provide flow control.
      Specified by:
        `setWriteQueueMaxSize` in interface `WriteStream<Buffer>`
      Parameters:
        `maxSize` - the max size of the write stream
      Returns:
        a reference to this, so the API can be used fluently

    - #### drainHandler

          PacketWritestream drainHandler(Handler<Void> handler)

      Description copied from interface: `WriteStream`
      Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue has been reduced to maxSize / 2. See `Pump` for an example of this being used.
      Specified by:
        `drainHandler` in interface `WriteStream<Buffer>`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

Copyright © 2015. All rights reserved.