Sometime VideoOS.Platform.SDK.StatusClient.StatusSession return timeout

Hi,

Sometime VideoOS.Platform.SDK.StatusClient.StatusSession return timeout and display error message on the screen.

How we can handle error message, we don’t want to display error message on screen.

We would like to error message in logs only.

Please suggest how we can handle error for StatusSession

************** Outer Exception **************

Exception type:System.Net.WebException

Exception message:The operation has timed out

Exception source:System.Web.Services

Exception Target Site: GetWebResponse

at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)

at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)

at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

at VideoOS.Platform.SDK.StatusClient.StatusSession.AsyncPoller.RegisterSubscriptionsIfNotRegistered()

at VideoOS.Platform.SDK.StatusClient.StatusSession.AsyncPoller.CommunicationThreadMainLoop()

************** System Info **************

Date and time: 17-09-2021 23:00:47

Machine Name: XXXXXXXXXX

Processors count: 8

OS version: Microsoft Windows NT 6.2.9200.0

64 bit OS: True

64 bit process: True

IP address: XXXXXXXXXXXXXXXX

Current user: XXXXXXXXX

Regards,

When developing a plugin you can handle exceptions.

Using the MIP logs is supported, perhaps the clearest description of how to use the logs is here: https://developer.milestonesys.com/s/article/debugging-techniques-for-Smart-Client-plugins

Hi @Bo Ellegård Andersen (Milestone Systems)​

Thanks for the feedback.

it described how to use the log but the problem is when VideoOS.Platform.SDK.StatusClient.StatusSession is not generating any external exception so I am not able catch in to try catch. It is showing error message from SDK it self.

Please suggest your feedback

Can you please show me the code in the plugin to initialize and use this “client”? Or, even better maybe you can show me a minimum implementation source code project so that I can reproduce and debug here in the Milestone test lab.

Hi @Bo Ellegård Andersen (Milestone Systems),

I need to create sample application from main project. I will create the sample application in 1-2 days and share the sample plugins code.

Hi @Bo Ellegård Andersen (Milestone Systems)​,

Please find attached sample application to reproduce the issue.

I am able to reproduce the same issue using sample application.

Let me know if any information required.

Regards,

I realized from your code what I should have realized from your description before seeing the code.

You reference VideoOS.Platform.SDK.dll, this is not recommended in a plugin, in general VideoOS.Platform.SDK.dll implements for standalone what the plugin environments (Smart Client/Management Client/Event Server) should have in themselves, and this can cause strange conflicts. Unfortunately, the StatusClient is not implemented in Smart Client.

With this in mind I wonder if we could persuade you to use NewEventsIndication instead of StatusClient.

The best sample for this is the StatusViewer sample. This sample is also standalone but the methods used in that sample will work for a plugin also (without needing to reference VideoOS.Platform.SDK.dll just referencing VideoOS.Platform. dll)

Please try it- https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/statusviewer/readme.html&tree=tree_2.html

Hi @Bo Ellegård Andersen (Milestone Systems)​ ,

thanks for the feedback. I will integrate NewEventsIndication and let you know if we face any issue.

Regards,

Hi @Bo Ellegård Andersen (Milestone Systems)​,

I have integrated NewEventsIndication now error is not generated but there is a problem when we directly register Camera to Xprotect.

If we add NVR then it is giving proper status but when we add camera directly status is always “Not Responding” even it is streaming video and management client show as a connected.

Can you please provide your feedback on this?

Please try to explain “add camera directly”, I do not really understand the scenario you are describing.

One suspicion is the fact that if you add a new camera in the Management Client the Smart Client does not know until you do a re-login, it only reads configuration at login. But the scenario will not fit as the Smart Client does not know the camera yet it will not be able to stream video as you say.

I mention the suspicion though I suspect it does not fit but please elaborate on this issue, what you do and what you observe.

thanks for the feedback

We are able to resolve the problem, there was some problem in Milestone Server, After restarting the Milestone server. it started working as expected