Exemplo n.º 1
0
 internal void HandlePeerDisconnect(SubscriberLink sub_link)
 {
     //Logger.LogDebug("PEER DISCONNECT: [" + sub_link.topic + "]");
     foreach (SubscriberCallbacks cbs in callbacks)
     {
         if (cbs.OnDisconnect != null && cbs.CallbackQueue != null)
         {
             var cb = new PeerConnDisconnCallback(cbs.OnDisconnect, sub_link);
             cbs.CallbackQueue.AddCallback(cb, cbs);
         }
     }
 }
Exemplo n.º 2
0
 internal void HandlePeerConnect(SubscriberLink sub_link)
 {
     //Logger.LogDebug($"PEER CONNECT: Id: {sub_link.connection_id} Dest: {sub_link.destination_caller_id} Topic: {sub_link.topic}");
     foreach (SubscriberCallbacks cbs in callbacks)
     {
         if (cbs.OnConnect != null && cbs.CallbackQueue != null)
         {
             var cb = new PeerConnDisconnCallback(cbs.OnConnect, sub_link);
             cbs.CallbackQueue.AddCallback(cb, cbs);
         }
     }
 }
Exemplo n.º 3
0
 public void peerDisconnect(SubscriberLink sub_link)
 {
     //ROS.Debug()( $"[{ThisNode.Name}]  PEER DISCONNECT: [{sub_link.topic}]" );
     foreach (SubscriberCallbacks cbs in callbacks)
     {
         if (cbs.disconnect != null && cbs.CallbackQueue != null)
         {
             var cb = new PeerConnDisconnCallback(cbs.disconnect, sub_link);
             cbs.CallbackId = cb.Uid;
             cbs.CallbackQueue.AddCallback(cb);
         }
     }
 }
Exemplo n.º 4
0
 public void peerConnect(SubscriberLink sub_link)
 {
     //ROS.Debug()( $"[{ThisNode.Name}] PEER CONNECT: Id: {sub_link.connection_id} Dest: {sub_link.destination_caller_id} Topic: {sub_link.topic}" );
     foreach (SubscriberCallbacks cbs in callbacks)
     {
         if (cbs.connect != null && cbs.CallbackQueue != null)
         {
             var cb = new PeerConnDisconnCallback(cbs.connect, sub_link);
             cbs.CallbackId = cb.Uid;
             cbs.CallbackQueue.AddCallback(cb);
         }
     }
 }
Exemplo n.º 5
0
 public void AddCallbacks(SubscriberCallbacks callbacks)
 {
     lock (gate)
     {
         this.callbacks.Add(callbacks);
         if (callbacks.OnConnect != null && callbacks.CallbackQueue != null)
         {
             foreach (SubscriberLink i in subscriberLinks)
             {
                 CallbackInterface cb = new PeerConnDisconnCallback(callbacks.OnConnect, i);
                 callbacks.CallbackQueue.AddCallback(cb, callbacks);
             }
         }
     }
 }
Exemplo n.º 6
0
 public void addCallbacks(SubscriberCallbacks callbacks)
 {
     lock ( callbacks_mutex )
     {
         this.callbacks.Add(callbacks);
         if (callbacks.connect != null && callbacks.CallbackQueue != null)
         {
             lock ( subscriber_links_mutex )
             {
                 foreach (SubscriberLink i in subscriber_links)
                 {
                     CallbackInterface cb = new PeerConnDisconnCallback(callbacks.connect, i);
                     callbacks.CallbackId = cb.Uid;
                     callbacks.CallbackQueue.AddCallback(cb);
                 }
             }
         }
     }
 }