void
ServerFinder::broadcast_thread ()
+try
{
boost::system::error_code error;
boost::asio::io_service io_service;
dcpomatic_sleep (10);
}
}
+catch (...)
+{
+ store_current ();
+}
void
ServerFinder::listen_thread ()
+try
{
while (1) {
shared_ptr<Socket> sock (new Socket (10));
}
}
}
+catch (...)
+{
+ store_current ();
+}
bool
ServerFinder::server_found (string ip) const
#include "lib/cinema.h"
#include "lib/kdm.h"
#include "lib/send_kdm_email_job.h"
+#include "lib/server_finder.h"
using std::cout;
using std::string;
f->Show ();
ui_signaller = new wxUISignaller (this);
- this->Bind (wxEVT_IDLE, boost::bind (&App::idle, this));
+ Bind (wxEVT_IDLE, boost::bind (&App::idle, this));
+ Bind (wxEVT_TIMER, boost::bind (&App::check, this));
+ _timer.reset (new wxTimer (this));
+ _timer->Start (1000);
+
return true;
}
catch (exception& e)
{
ui_signaller->ui_idle ();
}
+
+ void check ()
+ {
+ try {
+ ServerFinder::instance()->rethrow ();
+ } catch (exception& e) {
+ error_dialog (0, std_to_wx (e.what ()));
+ }
+ }
+
+ shared_ptr<wxTimer> _timer;
};
IMPLEMENT_APP (App)