summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-08-03 10:50:43 +0200
committerMichael Meeks <michael.meeks@suse.com>2012-08-06 10:23:10 +0100
commit98e52c47474e91dcaa5d41d8fd4925b17689fd65 (patch)
treec01b0e9f07b649ddbf5fe4f54331e0919bfa4faf /sd
parentcb82805c524e2d65ad75221bb50eee808c4177c8 (diff)
Hostname transfer implemented.
Change-Id: I92f2a3c00215491b6f24d52b922a4e4f2c461637
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/remotecontrol/DiscoveryService.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index bc514d7d3835..f482158a6633 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -60,15 +60,11 @@ DiscoveryService::~DiscoveryService()
void DiscoveryService::replyTo( sockaddr_in& rAddr )
{
-// SocketAddr aLocalAddr;
-// mSocket.getLocalAddr( aLocalAddr );
-// OString aAddrString = OUStringToOString( aLocalAddr.getHostname(),
-// RTL_TEXTENCODING_UTF8 );
-// 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) );
+ OStringBuffer aBuffer("LOREMOTE_ADVERTISE\n");
+ aBuffer.append( OUStringToOString( osl::SocketAddr::getLocalHostname(),
+ RTL_TEXTENCODING_UTF8 ) ).append( "\n\n" );
+ sendto( mSocket, aBuffer.getStr(), aBuffer.getLength(), 0,
+ (sockaddr*) &rAddr, sizeof(rAddr) );
}
void DiscoveryService::execute()