+ICECAdapter* g_parser;
+
+class CReconnect : public PLATFORM::CThread
+{
+public:
+ static CReconnect& Get(void)
+ {
+ static CReconnect _instance;
+ return _instance;
+ }
+
+ virtual ~CReconnect(void) {}
+
+ void* Process(void)
+ {
+ if (g_parser)
+ {
+ g_parser->Close();
+ if (!g_parser->Open(g_strPort.c_str()))
+ {
+ PrintToStdOut("Failed to reconnect\n");
+ g_bExit = true;
+ }
+ }
+ return NULL;
+ }
+
+private:
+ CReconnect(void) {}
+};