Beispiel #1
0
        private void onConnectionDropped(Connection conn, Connection.DropReason reason)
        {
#if DEBUG
            EDB.WriteLine("TransportPublisherLink: onConnectionDropped -- " + reason);
#endif
            if (dropping || conn != connection)
            {
                return;
            }
            if (reason == Connection.DropReason.TransportDisconnect)
            {
                needs_retry = true;
                next_retry  = DateTime.Now.Add(retry_period);
                if (retry_timer == null)
                {
                    retry_timer = ROS.timer_manager.StartTimer(onRetryTimer, 100);
                }
                else
                {
                    retry_timer.Restart();
                }
            }
            else
            {
                if (reason == Connection.DropReason.HeaderError)
                {
                    EDB.WriteLine("SOMETHING BE WRONG WITH THE HEADER FOR: " +
                                  (parent != null ? parent.name : "unknown"));
                }
                drop();
            }
        }
 private void onConnectionDropped(Connection conn, Connection.DropReason reason)
 {
     EDB.WriteLine("TransportPublisherLink: onConnectionDropped -- " + reason);
     if (dropping || conn != connection)
     {
         return;
     }
     lock (parent)
     {
         if (reason == Connection.DropReason.TransportDisconnect)
         {
             needs_retry = true;
             next_retry  = DateTime.Now.Add(retry_period);
             if (retry_timer == null)
             {
                 retry_period = TimeSpan.FromMilliseconds(100);
             }
             ROS.timer_manager.StartTimer(ref retry_timer, onRetryTimer,
                                          (int)Math.Floor(retry_period.TotalMilliseconds), Timeout.Infinite);
         }
         else
         {
             if (reason == Connection.DropReason.HeaderError)
             {
                 EDB.WriteLine("SOMETHING BE WRONG WITH THE HEADER FOR: " +
                               (parent != null ? parent.name : "unknown"));
             }
             drop();
         }
     }
 }
Beispiel #3
0
 private void OnConnectionDropped(Connection conn, Connection.DropReason r)
 {
     lock ( dropped_connections_mutex )
     {
         dropped_connections.Add(conn);
     }
 }
Beispiel #4
0
        private void onConnectionDropped(Connection conn, Connection.DropReason reason)
        {
            ROS.Debug()($"[{ThisNode.Name}] TransportPublisherLink: onConnectionDropped from remote {conn.RemoteString} with reason {reason.ToString()}");

            if (dropping || conn != connection)
            {
                return;
            }
            if (reason == Connection.DropReason.TransportDisconnect)
            {
                needs_retry = true;
                next_retry  = DateTime.UtcNow.Add(retry_period);
                if (retry_timer == null)
                {
                    retry_timer = ROS.timerManager.StartTimer(onRetryTimer, 100);
                }
                else
                {
                    retry_timer.Restart();
                }
            }
            else
            {
                if (reason == Connection.DropReason.HeaderError)
                {
                    ROS.Error()($"[{ThisNode.Name}] Error in the Header: {( parent != null ? parent.name : "unknown" )}");
                }
                drop();
            }
        }
Beispiel #5
0
 private void onConnectionDropped(Connection conn, Connection.DropReason reason)
 {
     if (conn != connection || parent == null)
     {
         return;
     }
     lock (parent)
     {
         parent.removeServiceClientLink(this);
     }
 }
Beispiel #6
0
        private void OnConnectionDropped(Connection conn, Connection.DropReason reason)
        {
            if (conn != connection || parent == null)
            {
                return;
            }

            ROS.Debug()($"[{ThisNode.Name}] TransportSubscriberLink: OnConnectionDropped from remote {conn.RemoteString} with reason {reason.ToString()}");
            lock ( parent )
            {
                parent.removeSubscriberLink(this);
            }
        }
        private void onConnectionDropped(Connection connection, Connection.DropReason dr)
        {
            if (connection != this.connection)
            {
                throw new Exception("WRONG CONNECTION ZOMG!");
            }

            ROS.Debug("Service client from [{0}] for [{1}] dropped", connection.RemoteString, name);

            clearCalls();

            ServiceManager.Instance.removeServiceServerLink(this);
        }
        private void onConnectionDropped(Connection connection, Connection.DropReason reason)
        {
            if (connection != this.connection)
            {
                throw new ArgumentException("Unknown connection", nameof(connection));
            }

            ROS.Debug()($"[{ThisNode.Name}] Service client from [{connection.RemoteString}] for [{name}] dropped");

            clearCalls();

            ServiceManager.Instance.RemoveServiceServerLink(this);

            IsValid = false;
        }
        private void onConnectionDropped(Connection connection, Connection.DropReason dr)
        {
            if (connection != this.connection)
            {
                throw new Exception("WRONG CONNECTION ZOMG!");
            }

#if DEBUG
            EDB.WriteLine("Service client from [{0}] for [{1}] dropped", connection.RemoteString, name);
#endif

            clearCalls();

            ServiceManager.Instance.removeServiceServerLink(this);

            IsValid = false;
        }
Beispiel #10
0
        public void Clear(Connection.DropReason reason)
        {
            List <Connection> local_connections = null;

            lock (connections_mutex)
            {
                local_connections = new List <Connection>(connections);
                connections.Clear();
            }
            foreach (Connection c in local_connections)
            {
                c.drop(reason);
            }

            lock (dropped_connections_mutex)
                dropped_connections.Clear();
        }
Beispiel #11
0
        public void Clear(Connection.DropReason reason)
        {
            RemoveDroppedConnections();

            Connection[] localConnections = null;
            lock ( connections_mutex )
            {
                localConnections = connections.ToArray();
                connections.Clear();
            }

            foreach (Connection c in localConnections)
            {
                if (!c.dropped)
                {
                    c.drop(reason);
                }
            }

            lock ( dropped_connections_mutex )
            {
                dropped_connections.Clear();
            }
        }