mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 21:55:10 +00:00
Fail if server is not ready when we try to broadcast
This commit is contained in:
@@ -367,7 +367,10 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
||||
}
|
||||
|
||||
NetworkPacket identity = NetworkPacket.createIdentityPacket(context);
|
||||
int port = (tcpServer == null || !tcpServer.isBound()) ? MIN_PORT : tcpServer.getLocalPort();
|
||||
if (tcpServer == null || !tcpServer.isBound()) {
|
||||
throw new RuntimeException("Wont't broadcast UDP packet if TCP socket is not ready");
|
||||
}
|
||||
int port = tcpServer.getLocalPort();
|
||||
identity.set("tcpPort", port);
|
||||
DatagramSocket socket = null;
|
||||
byte[] bytes = null;
|
||||
|
Reference in New Issue
Block a user