face: Implementing close operation and many related fixes in TcpFace and TcpChannel

Change-Id: Ib6b751e80454e149bf94f3867663d5e705cbf4a0
refs: #1250, #1248
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index ed78504..e2aa62d 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -27,6 +27,14 @@
 class Face : noncopyable, public enable_shared_from_this<Face>
 {
 public:
+  /**
+   * \brief Face-related error
+   */
+  struct Error : public std::runtime_error
+  {
+    Error(const std::string& what) : std::runtime_error(what) {}
+  };
+
   Face();
   
   virtual
@@ -51,6 +59,15 @@
   /// send a Data
   virtual void
   sendData(const Data& data) = 0;
+
+  /**
+   * \brief Close the face
+   *
+   * This terminates all communication on the face and cause
+   * onFail() method event to be invoked
+   */
+  virtual void
+  close() = 0;
   
   /** \brief Get whether underlying communicate is up
    *  In this base class this property is always true.