Class UdpClientIOProcessor

All Implemented Interfaces:
AutoCloseable, Runnable

public class UdpClientIOProcessor extends UdpBaseIOProcessor
Class to process client UDP communication. Client communication means communication with one UDP socket, initiated by this instance. Includes functionality for automatic data logging. Implementation is based on Java class DatagramChannel.
  • Constructor Details

    • UdpClientIOProcessor

      public UdpClientIOProcessor(JposDevice dev, String addr) throws jpos.JposException
      Stores JposDevice and port of derived IO processors. The device will be used for logging while the port specifies the communication object.
      Parameters:
      dev - Device that uses the processor. Processor uses logging of device to produce logging entries
      addr - Communication object, e.g. 127.0.0.1:23456 for IPv4 and [12:34:56:78:9a:bc:de:f0]:23456 for IPv6.
      Throws:
      jpos.JposException - If port does not specify a valid communication object
  • Method Details

    • setTarget

      public String setTarget(String target) throws jpos.JposException
      Description copied from class: UniqueIOProcessor
      Sets communication target. Depending on the IO processor type, setting communication target can be mandatory before calling method open.
      Overrides:
      setTarget in class UniqueIOProcessor
      Parameters:
      target - communication target
      Returns:
      target
      Throws:
      jpos.JposException - if target is not a valid communication target.
    • setParam

      public void setParam(int ownport) throws jpos.JposException
      Sets UDP specific communication parameter.
      Parameters:
      ownport - Own port address
      Throws:
      jpos.JposException - If port address < 0 or port address > 65535