Add missing disconnected impl
authorHyunho <hhstark.kang@samsung.com>
Thu, 6 May 2021 10:22:22 +0000 (19:22 +0900)
committerHyunho <hhstark.kang@samsung.com>
Thu, 6 May 2021 10:22:22 +0000 (19:22 +0900)
Signed-off-by: Hyunho <hhstark.kang@samsung.com>
cion/channel/client_channel.cc
cion/tizen-api/cion_server.cc

index 4621a2b185846308bbb9d8de79231749354f2bbe..862574f215ad75f412b3fa0974894d67d1449ec1 100644 (file)
@@ -146,11 +146,13 @@ void ClientChannel::Impl::OnOpened(VineDpPtr dp, int result) {
 
 void ClientChannel::Impl::Disconnect(VineDpPtr dp) {
   if (connected_peer_ != nullptr && connected_peer_->GetVineClientDp()) {
+    LOG(INFO) << "Compare " << dp->GetRawDp() << " : " << connected_peer_->GetVineClientDp()->GetRawDp();
     if (*connected_peer_->GetVineClientDp() == *dp) {
       parent_->OnDisconnected(connected_peer_);
       connected_peer_ = nullptr;
     }
   }
+  dp->Close();
   PopDp(dp);
 }
 
index f957dfab15453ef1b3aad3f5b913d1c4031793b5..9213ac736fceda10b4a123eef721b9d22a0c4477 100644 (file)
@@ -51,6 +51,10 @@ class CionServer : public cion::channel::ServerChannel {
   }
 
   void OnDisconnected(std::shared_ptr<cion::PeerInfo> peer) {
+    auto peerinfo = static_cast<cion_peer_info_h>(&peer);
+    std::string service_name = GetSerivceName();
+    for (const auto& cbdata : disconnected_cb_list_)
+      cbdata.cb(service_name.c_str(), peerinfo, cbdata.user_data);
   }
 
   std::vector<char> OnDataReceived(const std::vector<char>& data,