code: public void close() throws CGateException
      {
          if (!connected)
              return;
  
          synchronized (ping_connections)
          {
              try
              {
                  sendCommand("quit").toArray();
              }
              catch (Exception e) {}
  
              try
              {
                  command_connection.stop();
                  event_connection.stop();
                  status_change_connection.stop();
              }
              catch (Exception e)
              {
                  throw new CGateException(e);
              }
              finally
              {
                  clearCache();
                  connected = false;
                  ping_connections.notify();
              }
          }
      }
docs: Issue a <code>quit</code> to the C-Gate server and close the input and output stream
  and the command_socket.
  
  @see <a href="http://www.clipsal.com/cis/downloads/Toolkit/CGateServerGuide_1_0.pdf">
  <i>C-Gate Server Guide 4.3.99</i></a>
  @throws com.daveoxley.cbus.CGateException