mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-01 14:45:08 +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);
|
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);
|
identity.set("tcpPort", port);
|
||||||
DatagramSocket socket = null;
|
DatagramSocket socket = null;
|
||||||
byte[] bytes = null;
|
byte[] bytes = null;
|
||||||
|
Reference in New Issue
Block a user