mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[govee] make socket close more resilient (#17286)
* [govee] make socket close more resilient Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
This commit is contained in:
parent
d33b2ff0d1
commit
5ae87b8dee
@ -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