tagreader-python icon indicating copy to clipboard operation
tagreader-python copied to clipboard

Function connect and property isconnected/isavailable

Open asmfstatoil opened this issue 4 years ago • 1 comments

Make it possible to verify that provided is available for connection prior to / independent of actually attempting query.

Our use case can then fail nicely before reading a lot of config files to get the tags.

asmfstatoil avatar Mar 15 '21 20:03 asmfstatoil

Are you suggesting to set the property isconnected when connect() succeeds? isconnected == True will not be able to account for a broken connection after calling connect(), so I am wary to include such a property.

I can look into creating a method to check connectivity to server (e.g. by performing a basic query that should work on all servers). You can call that as often as you want and keep the status in your own application. Or simply attach it to the client yourself: client.isconnected = client.connect()

If you have suggestions for simple tests queries for one or more of the four IMS handlers used by Tagreader, please post them here.

einarsi avatar Apr 28 '21 07:04 einarsi