Is there some general easy way to recognize that server response is too long. Something like navigation timeout for laye. Or indication that service connection failed during communication not only when load layer. Thanks.
Are you thinking about an event, for example, that would be raised if the object (layer, e.g.) lost the server connection (or had some other server-related issue)? There's no mechanism in place for that (that I'm aware of). Instead, I think you need to be a little proactive if you want to check server status.
You can do a manual check by pinging a server for a response.
var status = this.CheckServer("myserver.com");
if (status == System.Net.NetworkInformation.IPStatus.Success)
private System.Net.NetworkInformation.IPStatus CheckServer(string url)
using (System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping())
reply = ping.Send(url);
... but unfortunately, 'ping' will be disabled for many servers.
Another option is to call GetAllDetailsAsync for a service (an ArcGISDynamicMapServiceLayer, e.g.). You can use that info to get the number of layers and tables in the service, metadata about all layers, the maximum record count returned, etc. (and verify that you get a response, of course). For example:
var info = await arcGISDynLayer.GetAllDetailsAsync();
var layerCount = info.Layers.Count;
var tableCount = info.Tables.Count;
foreach (var l in info.Layers)
// get info about each layer
foreach (var t in info.Tables)
// get info about each table