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 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(); } }