de.hfu.anybeam.networkCore

## Class NetworkBroadcast

- java.lang.Object
- - de.hfu.anybeam.networkCore.NetworkBroadcast

- All Implemented Interfaces:
    java.lang.Runnable

      public class NetworkBroadcast
      extends java.lang.Object
      implements java.lang.Runnable

  A `Runnable` sending a broadcast into the local network when executed.
  Since:
    1.0
  Version:
    1.0
  Author:
    chrwuer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetworkBroadcast(int port, byte[] payload, EncryptionType encryptionType, byte[] enncryptionKey)` Creates a new `NetworkBroadcast` object.
    `NetworkBroadcast(NetworkEnvironment owner, byte[] payload)` Creates a new `NetworkBroadcast` using the infos from the given `NetworkEnvironment`'s `NetworkEnvironmentSettings`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `run()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NetworkBroadcast

          public NetworkBroadcast(NetworkEnvironment owner,
                          byte[] payload)

      Creates a new `NetworkBroadcast` using the infos from the given `NetworkEnvironment`'s `NetworkEnvironmentSettings`. Keep in mind to execute this `Runnable`!
      Parameters:
        `owner` - the given `NetworkEnvironment` to get the needed infos from
        `payload` - the payload to send
      Throws:
        `java.io.IOException`

    - #### NetworkBroadcast

          public NetworkBroadcast(int port,
                          byte[] payload,
                          EncryptionType encryptionType,
                          byte[] enncryptionKey)

      Creates a new `NetworkBroadcast` object. Keep in mind to execute this `Runnable`!
      Parameters:
        `port` - the port to which the broadcast should be send
        `payload` - the payload that should be send
        `encryptionType` - the used `EncryptionType`
        `enncryptionKey` - the used encryption key or null if `EncryptionType.NONE` is used
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`