优化tcp网关

This commit is contained in:
zhou-hao 2020-08-05 14:37:05 +08:00
parent 8d190d1d20
commit 349cdbe3d3
1 changed files with 3 additions and 2 deletions

View File

@ -151,10 +151,11 @@ class TcpServerDeviceGateway implements DeviceGateway, MonitorSupportDeviceGatew
return client
.subscribe()
.filter(tcp -> started.get())
.doOnCancel(client::shutdown)
.publishOn(Schedulers.parallel())
.flatMap(this::handleTcpMessage)
.onErrorContinue((err, ignore) -> log.error(err.getMessage(), err))
.then();
.then()
.doOnCancel(client::shutdown);
}
Mono<Void> handleTcpMessage(TcpMessage message) {