类 MessageControl
java.lang.Object
com.huangjian.modbus4j.sero.messaging.MessageControl
- 所有已实现的接口:
DataConsumer
In general there are three messaging activities:
- Send a message for which no reply is expected, e.g. a broadcast.
- Send a message and wait for a response with timeout and retries.
- Listen for unsolicited requests.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidclose()close.voiddata(byte[] b, int len) Notifies the consumer that new data is availableintGetter for the fielddiscardDataDelay.getIoLog()Getter for the fieldioLog.intGetter for the fieldretries.intGetter for the fieldtimeout.Getter for the fieldtimeSource.voidhandleIOException.send(OutgoingRequestMessage request) send.send(OutgoingRequestMessage request, int timeout, int retries) send.voidsend(OutgoingResponseMessage response) send.voidsetDiscardDataDelay(int discardDataDelay) Setter for the fielddiscardDataDelay.voidsetExceptionHandler(MessagingExceptionHandler exceptionHandler) Setter for the fieldexceptionHandler.voidSetter for the fieldioLog.voidsetRetries(int retries) Setter for the fieldretries.voidsetTimeout(int timeout) Setter for the fieldtimeout.voidsetTimeSource(TimeSource timeSource) Setter for the fieldtimeSource.voidstart(Transport transport, MessageParser messageParser, RequestHandler handler, WaitingRoomKeyFactory waitingRoomKeyFactory) start.
-
字段详细资料
-
DEBUG
public boolean DEBUG
-
-
构造器详细资料
-
MessageControl
public MessageControl()
-
-
方法详细资料
-
start
public void start(Transport transport, MessageParser messageParser, RequestHandler handler, WaitingRoomKeyFactory waitingRoomKeyFactory) throws IOException start.
- 参数:
transport- aTransportobject.messageParser- aMessageParserobject.handler- aRequestHandlerobject.waitingRoomKeyFactory- aWaitingRoomKeyFactoryobject.- 抛出:
IOException- if any.
-
close
public void close()close.
-
setExceptionHandler
Setter for the field
exceptionHandler.- 参数:
exceptionHandler- aMessagingExceptionHandlerobject.
-
getRetries
public int getRetries()Getter for the field
retries.- 返回:
- a int.
-
setRetries
public void setRetries(int retries) Setter for the field
retries.- 参数:
retries- a int.
-
getTimeout
public int getTimeout()Getter for the field
timeout.- 返回:
- a int.
-
setTimeout
public void setTimeout(int timeout) Setter for the field
timeout.- 参数:
timeout- a int.
-
getDiscardDataDelay
public int getDiscardDataDelay()Getter for the field
discardDataDelay.- 返回:
- a int.
-
setDiscardDataDelay
public void setDiscardDataDelay(int discardDataDelay) Setter for the field
discardDataDelay.- 参数:
discardDataDelay- a int.
-
getIoLog
Getter for the field
ioLog.- 返回:
- a
BaseIOLogobject.
-
setIoLog
Setter for the field
ioLog.- 参数:
ioLog- aBaseIOLogobject.
-
getTimeSource
Getter for the field
timeSource.- 返回:
- a
TimeSourceobject.
-
setTimeSource
Setter for the field
timeSource.- 参数:
timeSource- aTimeSourceobject.
-
send
send.
- 参数:
request- aOutgoingRequestMessageobject.- 返回:
- a
IncomingResponseMessageobject. - 抛出:
IOException- if any.
-
send
public IncomingResponseMessage send(OutgoingRequestMessage request, int timeout, int retries) throws IOException send.
- 参数:
request- aOutgoingRequestMessageobject.timeout- a int.retries- a int.- 返回:
- a
IncomingResponseMessageobject. - 抛出:
IOException- if any.
-
send
send.
- 参数:
response- aOutgoingResponseMessageobject.- 抛出:
IOException- if any.
-
data
public void data(byte[] b, int len) Notifies the consumer that new data is availableIncoming data from the transport. Single-threaded.
- 指定者:
data在接口中DataConsumer- 参数:
b- array of bytes representing the incoming informationlen- length of the data
-
handleIOException
handleIOException.
- 指定者:
handleIOException在接口中DataConsumer- 参数:
e- aIOExceptionobject.
-