package inactivity
import "github.com/plgd-dev/go-coap/v3/net/monitor/inactivity"
Index ¶
- func CloseConn(cc Conn)
- type Conn
- type KeepAlive
- func NewKeepAlive[C Conn](maxRetries uint32, onInactive OnInactiveFunc[C], sendPing func(cc C, receivePong func()) (func(), error)) *KeepAlive[C]
- func (m *KeepAlive[C]) OnInactive(cc C)
- type Monitor
- func New[C Conn](duration time.Duration, onInactive OnInactiveFunc[C]) *Monitor[C]
- func (m *Monitor[C]) CheckInactivity(now time.Time, cc C)
- func (m *Monitor[C]) LastActivity() time.Time
- func (m *Monitor[C]) Notify()
- type NilMonitor
- func NewNilMonitor[C Conn]() *NilMonitor[C]
- func (m *NilMonitor[C]) CheckInactivity(time.Time, C)
- func (m *NilMonitor[C]) Notify()
- type OnInactiveFunc
Functions ¶
func CloseConn ¶
func CloseConn(cc Conn)
Types ¶
type Conn ¶
type KeepAlive ¶
type KeepAlive[C Conn] struct { // contains filtered or unexported fields }
func NewKeepAlive ¶
func NewKeepAlive[C Conn](maxRetries uint32, onInactive OnInactiveFunc[C], sendPing func(cc C, receivePong func()) (func(), error)) *KeepAlive[C]
func (*KeepAlive[C]) OnInactive ¶
func (m *KeepAlive[C]) OnInactive(cc C)
type Monitor ¶
type Monitor[C Conn] struct { // contains filtered or unexported fields }
func New ¶
func New[C Conn](duration time.Duration, onInactive OnInactiveFunc[C]) *Monitor[C]
func (*Monitor[C]) CheckInactivity ¶
func (*Monitor[C]) LastActivity ¶
func (*Monitor[C]) Notify ¶
func (m *Monitor[C]) Notify()
type NilMonitor ¶
type NilMonitor[C Conn] struct{}
func NewNilMonitor ¶
func NewNilMonitor[C Conn]() *NilMonitor[C]
func (*NilMonitor[C]) CheckInactivity ¶
func (m *NilMonitor[C]) CheckInactivity(time.Time, C)
func (*NilMonitor[C]) Notify ¶
func (m *NilMonitor[C]) Notify()
type OnInactiveFunc ¶
type OnInactiveFunc[C Conn] func(cc C)
Source Files ¶
- Version
- v3.3.6 (latest)
- Published
- Sep 18, 2024
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 week ago –
Tools for package owners.