Hi, I´m having trouble with a software development in which we are working. I´m getting the following error:
Error reading from stream! : Operation was cancelled while waiting for move operation response, or connection was closed by peer!
The code is the following:
private void ShowRotacion()
{
ShowImagen = false;
if (VideoOS.Platform.SDK.Environment.IsLoggedIn(new Uri(“http://” + ConfigurationManager.AppSettings.Get(“UrlMilestoneServer”))))
{
GetCamerasData();
var item = allCameras.FirstOrDefault(x => x.FQID.ObjectId == Guid.Parse(“EF99B2F2-BA76-4409-8585-EE1E21C25025”));
VideoOS.Platform.Data.JPEGVideoSource videoSource = new VideoOS.Platform.Data.JPEGVideoSource(item);
videoSource.Init();
JPEGData data = (JPEGData)videoSource.Get(DateTime.Now.AddDays(-1));
MemoryStream strmImg = new MemoryStream(data.Bytes);
Imagen = new BitmapImage();
Imagen.BeginInit();
Imagen.StreamSource = strmImg;
Imagen.DecodePixelWidth = 200;
Imagen.EndInit();
ShowImagen = true;
}
}
The line that is producing the error is JPEGData data = (JPEGData)videoSource.Get(DateTime.Now.AddDays(-1));
The complete stack is:
ERROR Uncaught Thread Exception EXCEPTION OCCURRED:VideoOS.Platform.MIPException: Error reading from stream! : Operation was cancelled while waiting for move operation response, or connection was closed by peer! —> VideoOS.Toolkit.StreamException: Error reading from stream!
at VideoOS.Toolkit.LivePlaybackSourceToolkit.MoveTo(DateTime timeStamp, SearchCriteria searchCriteria)
at VideoOS.Platform.SDK.Export.SDKInternalCommandService.DataGet[TReturnType](Object sessionId, FQID deviceFqid, DateTime time, Func`2 getAndHandleToolkitDataFunc, SearchCriteria searchCriteria)
-– End of inner exception stack trace —
at VideoOS.Platform.SDK.Export.SDKInternalCommandService.HandleToolkitExceptions(String method, Exception ex)
at VideoOS.Platform.SDK.Export.SDKInternalCommandService.DataGet[TReturnType](Object sessionId, FQID deviceFqid, DateTime time, Func`2 getAndHandleToolkitDataFunc, SearchCriteria searchCriteria)
at VideoOS.Platform.SDK.Export.SDKInternalCommandService.ImageExporterJPEGGetAt(Object sessionId, FQID deviceFQID, DateTime time)
at VideoOS.Platform.Data.GenericVideoSource`1.FireCommandInternal(Func`1 command)
at VideoOS.Platform.Data.GenericVideoSource`1.FireCommandInternal(Func`4 command, DateTime dateTime)
at VideoOS.Platform.Data.GenericVideoSource`1.Get(DateTime dateTime, TimeSpan maxTimeAfter, Int32 maxCountAfter)
at VideoOS.Platform.Data.GenericVideoSource`1.Get(DateTime dateTime)
at VideoOS.Platform.Data.JPEGVideoSource.Get(DateTime dateTime)
at XeoCode.ViewModels.Modal.ListadoRotacionesViewModel.ShowRotacion() in [D:\SVN\xeocode](file:D:/SVN/xeocode) limpio\XeoCode\ViewModels\Modal\ListadoRotacionesViewModel.cs:line 216
at XeoCode.ViewModels.Modal.ListadoRotacionesViewModel.ConsultarRotaciones() in [D:\SVN\xeocode](file:D:/SVN/xeocode) limpio\XeoCode\ViewModels\Modal\ListadoRotacionesViewModel.cs:line 178
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) XeoCode.App.App_DispatcherUnhandledException([D:\SVN\xeocode](file:D:/SVN/xeocode) limpio\XeoCode\App.xaml.cs:421)