Documentation ¶
Index ¶
- Constants
- type Client
- type Handler
- type NopProc
- func (NopProc) ProcReadCoils(byte, uint16, uint16, []byte)
- func (NopProc) ProcReadDiscretes(byte, uint16, uint16, []byte)
- func (NopProc) ProcReadHoldingRegisters(byte, uint16, uint16, []byte)
- func (NopProc) ProcReadInputRegisters(byte, uint16, uint16, []byte)
- func (NopProc) ProcResult(_ error, result *Result)
- type Option
- type Request
- type Result
Constants ¶
View Source
const ( // DefaultRandValue 单位ms // 默认随机值上限,它影响当超时请求入ready队列时, // 当队列满,会启动一个随机时间rand.Intn(v)*1ms 延迟入队 // 用于需要重试的延迟重试时间 DefaultRandValue = 50 // DefaultReadyQueuesLength 默认就绪列表长度 DefaultReadyQueuesLength = 128 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client 客户端
type Handler ¶
type Handler interface { ProcReadCoils(slaveID byte, address, quality uint16, valBuf []byte) ProcReadDiscretes(slaveID byte, address, quality uint16, valBuf []byte) ProcReadHoldingRegisters(slaveID byte, address, quality uint16, valBuf []byte) ProcReadInputRegisters(slaveID byte, address, quality uint16, valBuf []byte) ProcResult(err error, result *Result) }
Handler 处理函数
type NopProc ¶
type NopProc struct{}
func (NopProc) ProcReadHoldingRegisters ¶
func (NopProc) ProcReadInputRegisters ¶
func (NopProc) ProcResult ¶
type Option ¶
type Option func(client *Client)
Option 可选项
func WitchPanicHandle ¶
func WitchPanicHandle(f func(interface{})) Option
WitchPanicHandle 发生panic回调,主要用于调试
func WitchRetryRandValue ¶
WitchRetryRandValue 单位ms 默认随机值上限,它影响当超时请求入ready队列时, 当队列满,会启动一个随机时间rand.Intn(v)*1ms 延迟入队 用于需要重试的延迟重试时间
Click to show internal directories.
Click to hide internal directories.