summaryrefslogtreecommitdiff
path: root/src/lib/server_finder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-12-30 23:10:49 +0000
committerCarl Hetherington <cth@carlh.net>2013-12-30 23:10:49 +0000
commit6670f11c639e3515256f4f0eb3699e02155f67c9 (patch)
tree1bdd2045e2cd2cb988a2bf209fecc0cb29e817b1 /src/lib/server_finder.cc
parentf87a0f16f8cee026ee33c3a46b93b43d4b3cf5ff (diff)
Handle exceptions thrown from ServerFinder.
Diffstat (limited to 'src/lib/server_finder.cc')
-rw-r--r--src/lib/server_finder.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/server_finder.cc b/src/lib/server_finder.cc
index de90e0d5c..5b67d8048 100644
--- a/src/lib/server_finder.cc
+++ b/src/lib/server_finder.cc
@@ -47,6 +47,7 @@ ServerFinder::ServerFinder ()
void
ServerFinder::broadcast_thread ()
+try
{
boost::system::error_code error;
boost::asio::io_service io_service;
@@ -88,9 +89,14 @@ ServerFinder::broadcast_thread ()
dcpomatic_sleep (10);
}
}
+catch (...)
+{
+ store_current ();
+}
void
ServerFinder::listen_thread ()
+try
{
while (1) {
shared_ptr<Socket> sock (new Socket (10));
@@ -117,6 +123,10 @@ ServerFinder::listen_thread ()
}
}
}
+catch (...)
+{
+ store_current ();
+}
bool
ServerFinder::server_found (string ip) const