Class UdpClient

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Runnable

    public class UdpClient
    extends Client
    implements Closeable
    Provides a KDC client for sending and receiving agents using the UDP protocol.

    UDP communication is asynchronous and does not support synchronous agent requests.

    Author:
    Charles B. Kozoyed
    See Also:
    Client, UdpClientParameters
    • Constructor Detail

      • UdpClient

        public UdpClient​(UdpClientParameters parameters)
                  throws com.kristensoft.kdc.license.runtime.LicenseException,
                         SocketException
        Creates a UDP client using the specified parameters.
        Parameters:
        parameters - the configuration parameters for this UDP client
        Throws:
        com.kristensoft.kdc.license.runtime.LicenseException - if the KDC license does not permit creation of the client
        SocketException - if automatic startup is enabled and the UDP socket cannot be created or configured
    • Method Detail

      • getUdpClientParameters

        public UdpClientParameters getUdpClientParameters()
        Returns the configuration parameters for this UDP client.
        Returns:
        the UDP client parameters
      • close

        public void close()
        Closes the UDP socket associated with this client.

        If no socket is currently open, this method has no effect.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in class Client
      • isRunning

        public boolean isRunning()
        Determines whether this communication entity is currently running.
        Returns:
        true if this communication entity is running; false otherwise
      • flushMetrics

        public void flushMetrics()
        Flushes the accumulated latency metrics for this communication entity.

        This method may be used to report any currently accumulated metrics without waiting for the configured latency reporting interval.

      • getAgentSerializer

        public AgentSerializer getAgentSerializer()
        Returns the agent serializer used by this communication entity.

        The serializer may be used to inspect or modify serialization settings at runtime, including compression and encryption settings.

        Returns:
        the agent serializer used by this communication entity