Class MulticastClient

java.lang.Object
de.willuhn.net.MulticastClient

public class MulticastClient extends Object
Eine kleine Hilfsklasse fuer RMI Multicast-Discovery.
  • Field Details

  • Constructor Details

    • MulticastClient

      public MulticastClient() throws IOException
      Erzeugt einen neuen Listener auf der Standard-Adresse mit dem Standard-Port.
      Throws:
      IOException
    • MulticastClient

      public MulticastClient(String address, int port) throws IOException
      Erzeugt einen neuen Listener mit expliziter Angabe von Adresse und Port.
      Parameters:
      address - Adresse.
      port - Port.
      Throws:
      IOException
  • Method Details

    • stop

      public void stop() throws IOException
      Stoppt den Listener.
      Throws:
      IOException
    • send

      public void send(byte[] data) throws IOException
      Sendet Daten via Multicast.
      Parameters:
      data -
      Throws:
      IOException
    • received

      public void received(DatagramPacket packet) throws IOException
      Nimmt die empfangenen Daten entgegen. Sollte ueberschrieben werden, wenn man die Daten nutzen will.
      Parameters:
      packet -
      Throws:
      IOException
    • main

      public static final void main(String[] args) throws Exception
      ZUm Testen. Daten koennen via Kommandozeile uebergeben werden.
      Parameters:
      args -
      Throws:
      Exception