com.h3c.util.net

## Interface DatagramEngine

- All Known Implementing Classes:
    DefaultDatagramEngine

      public interface DatagramEngine

  Datagram engine interface. This provides an abstraction to datagram sending, datagram receiving and threading implementation.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `DatagramEngine.Listener` Provides an interface for the notifications from the engine.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `MAX_REQUEST_SIZE`
    `static int` | `MAX_RESPONSE_SIZE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `send(byte[] payload, InetSocketAddress address)` Main entry point to write the payload in a new datagram.
    `void` | `setListener(DatagramEngine.Listener listener)` Allows the setting of the engine listener.
    `void` | `start()` Starts the engine.
    `void` | `stop()` Stops the engine.

- - ### Field Detail

    - #### MAX_REQUEST_SIZE

          static final int MAX_REQUEST_SIZE

      See Also:
        Constant Field Values

    - #### MAX_RESPONSE_SIZE

          static final int MAX_RESPONSE_SIZE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setListener

          void setListener(DatagramEngine.Listener listener)

      Allows the setting of the engine listener. All engine implementations need to save the listener.
      Parameters:
        `listener` - engine listener

    - #### start

          void start()

      Starts the engine.

    - #### stop

          void stop()

      Stops the engine. Engine implementations should shutdown all resources, worker threads, etc.

    - #### send

          void send(byte[] payload,
                  InetSocketAddress address)

      Main entry point to write the payload in a new datagram.
      Parameters:
        `payload` - datagram payload
        `address` - socket address to send payload

Copyright © 2014. All Rights Reserved.