Package de.gmxhome.conrad.jpos.jpos_base
Class UdpClientIOProcessor
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.UniqueIOProcessor
de.gmxhome.conrad.jpos.jpos_base.UdpBaseIOProcessor
de.gmxhome.conrad.jpos.jpos_base.UdpClientIOProcessor
- All Implemented Interfaces:
AutoCloseable
,Runnable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.gmxhome.conrad.jpos.jpos_base.UdpBaseIOProcessor
UdpBaseIOProcessor.Frame
-
Field Summary
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.UdpBaseIOProcessor
OwnPort, Socket, SourceIP, TargetIP
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.UniqueIOProcessor
Dev, InitialPort, IOProcessorError, LoggingData, LoggingPrefix, LoggingType, LoggingTypeEscapeString, LoggingTypeHexString, LoggingTypeNoLogging, Port, Source, Target, Timeout
-
Constructor Summary
ConstructorsConstructorDescriptionUdpClientIOProcessor(JposDevice dev, String addr)
Stores JposDevice and port of derived IO processors. -
Method Summary
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.UdpBaseIOProcessor
available, close, flush, open, read, run, setTimeout, write
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.UniqueIOProcessor
getSource, getTarget, location, logerror, logerror, logerror, setLoggingType, toLogString
-
Constructor Details
-
UdpClientIOProcessor
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 entriesaddr
- 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
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 classUniqueIOProcessor
- 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.JposExceptionSets UDP specific communication parameter.- Parameters:
ownport
- Own port address- Throws:
jpos.JposException
- If port address < 0 or port address > 65535
-