Reputation: 709
Are there any settings on an azure website that would prevent access to a webAPI service from a mobile phone using the mobile network? Access seems fine when using WIFI, but when using the mobile network the operation consistently times out.
Upvotes: 0
Views: 73
Reputation: 17182
Use detect mobile browsers, and using that you can setup a Delegating handler in ASP.Net Web API. If in Delegating handler it is found that request came from Mobile browser, then return a different HttpResponseMessage (probably with a Error code), or else simply serve the request.
So far for detecting Network speed, You cannot using ASP.Net. You have to have client side technology like Silverlight etc., to perform those calculations.
Upvotes: 1
Reputation: 1127
This probably won't be possible, because an azure web site (any web server actually) has no knowledge wether you're accessing it from Wifi, optical fiber, DSL or mobile network. All a web server is aware of are http requests, and probably TCP packets if you're willing to dig low-level enough. That's still several layers above the physical one in the osi layers model.
If all you need is quickly displaying an error message to the user when he uses a slow connection, maybe a short client side timeout setting when accessing the web api would have the same effect ?
Upvotes: 0