Quantcast
Channel: Azure Networking (DNS, Traffic Manager, VPN, VNET) forum
Viewing all articles
Browse latest Browse all 6513

Iphone Application with Azure backend, DNS issues

$
0
0
I have an iPhone app with an Azure Web Services virtual machine as backend. The machine uses Windows 2008 server with WAMP installed to serve requests.
From time to time, the machine doesn't respond to requests done from my app. It doesn't work for 10 to 2 minutes then it works again and so on.

I use this code to connect to the server:

    NSString *Url_String = [NSString stringWithFormat:@"%@%@",Main_URL,Get_Data_URL];
    NSString *Post_String = Post_String = [NSString stringWithFormat:@"time=%d",0];
    NSMutableURLRequest *Request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:Url_String]];
    [Request setHTTPMethod:@"POST"];
    [Request setHTTPBody:[Post_String dataUsingEncoding:NSUTF8StringEncoding]];
    NSURLConnection* Connection = [NSURLConnection connectionWithRequest:Request delegate:self];
    
In the method : 

    - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
    NSLog(@"Unable to connect to server - Error %@",error);
    NSLog(@"%@",[[connection currentRequest] URL]);

The following appears :

    Unable to connect to server - Error Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0x11558f230 {NSUnderlyingError=0x11561a450 "A server with the specified hostname could not be found."

A few things to mention:  
- If I connect via the ip of the machine everything works perfectly.  
- The error appears only on WIFI. On 3G it works perfectly.  
- I have tried to use both my website domain name bought from GoDaddy by trying to use as Main_Url http://www.applicationame.com and the domain name Azure Web Services adress http://aplication.cloudapp.net  
- If I retry to connect over and over, no matter the interval between connections, it works at a certain point in time. This time is way to long to work in normal conditions.

From what I've seen in this http://stackoverflow.com/questions/6573324/nsurlconnection-failure-1003 it seems to be a problem with the DNS not being resolved.

Does anyone have any insight?

Viewing all articles
Browse latest Browse all 6513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>