Package com.kristensoft.kdc
Class UdpClient
- java.lang.Object
-
- com.kristensoft.kdc.Client
-
- com.kristensoft.kdc.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 Summary
Constructors Constructor Description UdpClient(UdpClientParameters parameters)Creates a UDP client using the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the UDP socket associated with this client.voidflushMetrics()Flushes the accumulated latency metrics for this communication entity.AgentSerializergetAgentSerializer()Returns the agent serializer used by this communication entity.UdpClientParametersgetUdpClientParameters()Returns the configuration parameters for this UDP client.booleanisRunning()Determines whether this communication entity is currently running.-
Methods inherited from class com.kristensoft.kdc.Client
getClientParameters, getServerHub, halt, nextReply, peekReply, pollReply, pollReply, replyAvailable, run, sendAsync, start, stop, takeReply
-
-
-
-
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 clientSocketException- 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.
-
isRunning
public boolean isRunning()
Determines whether this communication entity is currently running.- Returns:
trueif this communication entity is running;falseotherwise
-
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
-
-