2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 21:55:10 +00:00

Broadcast actual tcp server port used

Summary: UDP Identity packet should set tcpPort to the actual tcpServer port used

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, nicolasfella, sredman, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16351
This commit is contained in:
Erik Duisters
2018-10-25 21:03:10 +02:00
committed by Albert Vaca
parent 51c0a713bc
commit 2c32bd334a

View File

@@ -393,7 +393,8 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
iplist.add("255.255.255.255"); //Default: broadcast.
NetworkPacket identity = NetworkPacket.createIdentityPacket(context);
identity.set("tcpPort", MIN_PORT);
int port = (tcpServer == null || !tcpServer.isBound()) ? MIN_PORT : tcpServer.getLocalPort();
identity.set("tcpPort", port);
DatagramSocket socket = null;
byte[] bytes = null;
try {