AlexStocks / getty

a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Apache License 2.0
883 stars 184 forks source link

getty可以用来做物联网modbus长连接网关吗,每个连接需要进行定时下发指令到设备 #70

Closed ZhangChengJi closed 1 year ago

AlexStocks commented 1 year ago

如果是处理 TCP 协议,应该是可以的。定时任务在 OnCron 里面执行。

ZhangChengJi commented 1 year ago

OnCron好像不可以,需要每个连接建立自己的定时任务,

ZhangChengJi commented 1 year ago

我现在是通过时间轮建立定时任务下发的task,然后存储到sync.map

AlexStocks commented 1 year ago

OnCron好像不可以,需要每个连接建立自己的定时任务,

OnCron 确实是连接级别的,每个连接单独一个

AlexStocks commented 1 year ago

我现在是通过时间轮建立定时任务下发的task,然后存储到sync.map

有解决方法就好

AlexStocks commented 1 year ago

你能否来 https://github.com/AlexStocks/getty/issues/40 这里登记下?