Class MainServer

java.lang.Object
jmri.jmrit.z21server.MainServer
All Implemented Interfaces:
PropertyChangeListener, Runnable, EventListener

public class MainServer extends Object implements Runnable, PropertyChangeListener
This is a server for Z21 clients like the Z21 App or the Roco Z21 WlanMaus. It is not meant to be a fully equipped Z21 server.
  • Field Details

  • Constructor Details

  • Method Details

    • run

      public void run()
      The main server running in a separate thread. Do some setup and then read from the network in loop.
      Specified by:
      run in interface Runnable
    • sendResponseToRegisteredClients

      public void sendResponseToRegisteredClients(byte[] response)
      Send a Z21 packet to all registered clients.
      Parameters:
      response - - a Z21 packet
    • sendResponse

      public void sendResponse(InetAddress respAddress, byte[] response)
      Send a Z21 packet to a single client.
      Parameters:
      respAddress - - client's InetAdress
      response - - a Z21 packet
    • propertyChange

      Change listener. If new value contains a Z21 packet, send it to all registered clients.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      pce - - property change event from the caller