summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-08-07 09:29:35 +0200
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2012-08-07 09:33:35 +0200
commit67f688b97aa5afde455674dbe28297a89d817503 (patch)
tree6799510fd355349a0f497682269015fd8ea069f8 /sd
parentb0f2d55fe5ae0087079887bff61403afbade2415 (diff)
Hopefully cleanly close Server Thread when necessary.
Change-Id: If5a850b2f4c813c5a277ed0d4bc5179dd4095b10
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/remotecontrol/Server.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index 9be7f2b3d515..cb982de76b96 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -112,7 +112,10 @@ void RemoteServer::execute()
while ( true )
{
fprintf( stderr, "Awaiting a connection.\n" );
- mSocket.acceptConnection( mStreamSocket );
+ if ( mSocket.acceptConnection( mStreamSocket ) == osl_Socket_Error ) {
+ // Socket closed or other problem
+ return;
+ }
fprintf( stderr, "Accepted a connection!\n" );
listenThread();
}