summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java21
-rw-r--r--sd/source/ui/remotecontrol/DiscoveryService.cxx2
2 files changed, 13 insertions, 10 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
index d787e3478f1c..b78a9a43feb0 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
@@ -40,16 +40,17 @@ public class ServerFinder {
if (i == aBuffer.length || !aCommand.equals("LOREMOTE_ADVERTISE")) {
return;
}
-
- for (int j = i + 1; j < aBuffer.length; j++) {
- if (aPacket.getData()[j] == '\n') {
- aAddress = new String(aPacket.getData(), i + 1, j, CHARSET);
- }
- }
-
- if (aAddress != null) {
- System.out.println("Address is :" + aAddress + "\n");
- }
+ System.out.println("SF: " + aPacket.getAddress().toString());
+
+ // for (int j = i + 1; j < aBuffer.length; j++) {
+ // if (aPacket.getData()[j] == '\n') {
+ // aAddress = new String(aPacket.getData(), i + 1, j, CHARSET);
+ // }
+ // }
+ //
+ // if (aAddress != null) {
+ // System.out.println("Address is :" + aAddress + "\n");
+ // }
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index 612332fac08e..bc514d7d3835 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -67,6 +67,8 @@ void DiscoveryService::replyTo( sockaddr_in& rAddr )
// OStringBuffer aBuffer( "LOREMOTE_ADVERTISE\n" );
// aBuffer.append( aAddrString ).append( "\n" );
// mSocket.sendTo( rAddr, aBuffer.getStr(), aBuffer.getLength() );
+ OString aMessage("LOREMOTE_ADVERTISE\n");
+ sendto( mSocket, aMessage.getStr(), aMessage.getLength(), 0, (sockaddr*) &rAddr, sizeof(rAddr) );
}
void DiscoveryService::execute()