summaryrefslogtreecommitdiff
path: root/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-02-18 14:40:24 +0000
committerThorsten Behrens <tbehrens@suse.com>2013-02-19 13:00:29 +0100
commit4a7f9c7da446aeb6a5a9010ed7f44ffc40fc67ca (patch)
treeee24f7fec91d8628570b8f99ae9c9e0636705aee /sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
parent25819137fe00afa6ec5cb900a742fa9368a52a16 (diff)
sdremote: listening to dynamic changes to adapters.
Allows LibreOffice to start with no bluetooth, and for it to appear and disappear dynamically at run-time, cleaning up stale bluetooth sockets, and re-binding successfully each time. Change-Id: Ifa04c8cc1859c98adca94ac0e57c7ebd85f2f31f (cherry picked from commit 93abe8688a4700c04b5ab045eb296298e1b49031) Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Diffstat (limited to 'sd/source/ui/remotecontrol/BufferedStreamSocket.cxx')
-rw-r--r--sd/source/ui/remotecontrol/BufferedStreamSocket.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
index d35b6065523d..c4f7f611f665 100644
--- a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
+++ b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
@@ -27,7 +27,7 @@ BufferedStreamSocket::BufferedStreamSocket( const osl::StreamSocket &aSocket ):
aRead( 0 ),
aBuffer(),
mSocket( 0 ),
- usingCSocket( false)
+ usingCSocket( false )
{
}
@@ -55,6 +55,17 @@ sal_Int32 BufferedStreamSocket::write( const void* pBuffer, sal_uInt32 n )
return ::send( mSocket, (const char *) pBuffer, (size_t) n, 0 );
}
+void BufferedStreamSocket::close()
+{
+ if( usingCSocket )
+ {
+ ::close( mSocket );
+ mSocket = -1;
+ }
+ else
+ close();
+}
+
sal_Int32 BufferedStreamSocket::readLine( OString& aLine )
{
while ( true )