alert stream

Jun 2, 2024
1
0
medan
how can i detect this endpoint /ISAPI/Event/notification/alertStream stop suddenly?
when the device die, there isnt null response get from the deivce i cant recognize the end of stream then my app wont terminate
anyone can help???
 
You need to do heartbeat every x seconds. Hikvision default is 30s for their devices web interface.

1717396613595.png

If you get anything other than 200 , something is wrong.

So lets say you run 2 services together, 1 for checking device status. other for fetching data.

Once device status is offline, make a cancellation token with request timed out.
Once the status has been restored, restart the alrtstream service.

Other option is to run HTTP Listener instead of alertStream http transmission.
You can set up your server ip at camera settings where event push will be and on what port.
This way your server side needs to have TCP server listener on certain port. And there you can track incoming data with connect/disconnect
 
  • Like
Reactions: alastairstevenson
You might aswell use any GET endpoint, if device is offline you wont get anything anyway. Could be capabilities or any other GET information