Index: /trunk/FACT++/src/fscctrl.cc
===================================================================
--- /trunk/FACT++/src/fscctrl.cc	(revision 16730)
+++ /trunk/FACT++/src/fscctrl.cc	(revision 16731)
@@ -5,4 +5,5 @@
 #include "Shell.h"
 #include "StateMachineDim.h"
+#include "StateMachineAsio.h"
 #include "Connection.h"
 #include "LocalControl.h"
@@ -716,5 +717,5 @@
 
 template <class T, class S>
-class StateMachineFSC : public T, public ba::io_service, public ba::io_service::work
+class StateMachineFSC : public StateMachineAsio<T>
 {
 private:
@@ -726,10 +727,4 @@
         fFSC.PostClose(false);
 
-        /*
-         // Now wait until all connection have been closed and
-         // all pending handlers have been processed
-         poll();
-         */
-
         return T::GetCurrentState();
     }
@@ -742,5 +737,5 @@
         // Now wait until all connection have been closed and
         // all pending handlers have been processed
-        poll();
+        ba::io_service::poll();
 
         if (evt.GetBool())
@@ -755,11 +750,4 @@
     int Execute()
     {
-        // Dispatch (execute) at most one handler from the queue. In contrary
-        // to run_one(), it doesn't wait until a handler is available
-        // which can be dispatched, so poll_one() might return with 0
-        // handlers dispatched. The handlers are always dispatched/executed
-        // synchronously, i.e. within the call to poll_one()
-        poll_one();
-
         return fFSC.IsConnected() ? State::kConnected : State::kDisconnected;
     }
@@ -798,14 +786,6 @@
 public:
     StateMachineFSC(ostream &out=cout) :
-        T(out, "FSC_CONTROL"), ba::io_service::work(static_cast<ba::io_service&>(*this)),
-        fFSC(*this, *this)
-    {
-        // ba::io_service::work is a kind of keep_alive for the loop.
-        // It prevents the io_service to go to stopped state, which
-        // would prevent any consecutive calls to run()
-        // or poll() to do nothing. reset() could also revoke to the
-        // previous state but this might introduce some overhead of
-        // deletion and creation of threads and more.
-
+        StateMachineAsio<T>(out, "FSC_CONTROL"), fFSC(*this, *this)
+    {
         // State names
         T::AddStateName(State::kDisconnected, "Disconnected",
