}, user_data);
}
+bool VineManager::StopDiscovery(int channel_id) {
+ std::shared_ptr<SessionInfo> info = GetSessionInfo(channel_id);
+ if (info->IsDiscovering()) {
+ LOGE("Already discovering (%d)", channel_id);
+ return false;
+ }
+
+ vine_session_unset_discovered_cb(info->GetSession());
+ vine_session_stop_discovery(info->GetSession());
+ info->SetIsDiscovering(false);
+ return true;
+}
+
bool VineManager::Discovery(int channel_id) {
std::shared_ptr<SessionInfo> info = GetSessionInfo(channel_id);
if (info->IsDiscovering()) {
Discovery(channel_id);
break;
case IControlInfo::ControlType::StopDiscovery :
+ StopDiscovery(channel_id);
break;
}
} else if (info->GetChannelType() == IControlInfo::ChannelType::Broadcast) {
std::shared_ptr<PeerInfo> peer_info);
void RegisterService(std::shared_ptr<SessionInfo> info, int port);
bool Discovery(int channel_id);
+ bool StopDiscovery(int channel_id);
void OpenServer(int channel_id);
channel::IEventObserver* GetObserver(int channel_id);
std::shared_ptr<SessionInfo> GetSessionInfo(int channel_id);