mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
[govee] make socket close more resilient (#17286)
* [govee] make socket close more resilient Signed-off-by: Stefan Höhn <mail@stefanhoehn.com> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
396ff0b7c3
commit
6f9b3d2bbf
@ -200,7 +200,12 @@ public class CommunicationManager {
|
||||
socket.setReuseAddress(true);
|
||||
while (!stopped) {
|
||||
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
|
||||
socket.receive(packet);
|
||||
if (!socket.isClosed()) {
|
||||
socket.receive(packet);
|
||||
} else {
|
||||
logger.warn("Socket was unexpectedly closed");
|
||||
break;
|
||||
}
|
||||
if (stopped) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user