title: Interruption handling with non-static member function
body: <p>I am trying to do interruption handling with a member function from a class.</p>
  
  <p>The code is </p>
  
  <pre><code>signal(SIGABRT, socketServer.signalHandler);
  </code></pre>
  
  <p>where the definition of <code>signalHandler</code> is</p>
  
  <pre><code>public:
  void SocketServer::signalHandler(int sig)
  {
    logger.info("Receive SIG"+to_string(sig)+" Stopping server now...");
    stop();
  }
  </code></pre>
  
  <p>When I compile the code, I got an error says</p>
  
  <pre><code>main.cpp:32:32: error: reference to non-static member function must be called
    signal(SIGABRT, socketServer.signalHandler);
  </code></pre>
  
  <p>I am trying to capture <code>SIGABRT</code> using this <code>signalHandler</code> function and to clean up and stop the <code>socketServer</code> instance. I guess I can use global variable and a global function to do the job, but any thoughts about doing this with a member function?</p>