类 StreamTransport
java.lang.Object
com.huangjian.modbus4j.sero.messaging.StreamTransport
First, instatiate with the streams. Then add a data consumer, or create a message control and pass this as the
transport (which will make the message control the data consumer). Change the read delay if desired. This class
supports running in its own thread (start) or an external one (run), say from a thread pool. Both approaches are
delegated to the stream listener. In either case, stop the transport with the stop method (or just stop the message
control).
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidremoveConsumer.voidrun()run.voidsetConsumer(DataConsumer consumer) setConsumer.voidsetReadDelay(int readDelay) setReadDelay.voidstart.voidstop()stop.voidwrite(byte[] data) write.voidwrite(byte[] data, int len) write.
-
字段详细资料
-
out
-
in
-
-
构造器详细资料
-
StreamTransport
Constructor for StreamTransport.
- 参数:
in- aInputStreamobject.out- aOutputStreamobject.
-
-
方法详细资料
-
setReadDelay
public void setReadDelay(int readDelay) setReadDelay.
- 参数:
readDelay- a int.
-
start
start.
- 参数:
threadName- aStringobject.
-
stop
public void stop()stop.
-
run
public void run()run.
-
setConsumer
setConsumer.
- 指定者:
setConsumer在接口中Transport- 参数:
consumer- aDataConsumerobject.
-
removeConsumer
public void removeConsumer()removeConsumer.
- 指定者:
removeConsumer在接口中Transport
-
write
write.
- 指定者:
write在接口中Transport- 参数:
data- an array ofobjects.引用无效
byte- 抛出:
IOException- if any.
-
write
write.
- 指定者:
write在接口中Transport- 参数:
data- an array ofobjects.引用无效
bytelen- a int.- 抛出:
IOException- if any.
-