comparison ServerComms.mm @ 32:ab7c86d0f3d8

V0.3 SZBeta sent out. bristol tests.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 08 Mar 2013 14:54:55 +0000
parents 23ef179c3748
children a42903c61558
comparison
equal deleted inserted replaced
31:23ef179c3748 32:ab7c86d0f3d8
29 } 29 }
30 self.currentRequestType = type; 30 self.currentRequestType = type;
31 NSString *localServerURL = @"http://127.0.0.1:8080/testservice/"; 31 NSString *localServerURL = @"http://127.0.0.1:8080/testservice/";
32 NSString *webServerURL = @"http://www.isophonics.net/datacollector/"; 32 NSString *webServerURL = @"http://www.isophonics.net/datacollector/";
33 33
34 NSString *urls = [localServerURL stringByAppendingString:type]; 34 NSString *urls = [webServerURL stringByAppendingString:type];
35 NSURL *url = [NSURL URLWithString:urls]; 35 NSURL *url = [NSURL URLWithString:urls];
36 36
37 37
38 // request object 38 // request object
39 NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 39 NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
63 BOOL success; 63 BOOL success;
64 64
65 NSString *localServerURL = @"http://127.0.0.1:8080/testservice/"; 65 NSString *localServerURL = @"http://127.0.0.1:8080/testservice/";
66 NSString *webServerURL = @"http://www.isophonics.net/datacollector/"; 66 NSString *webServerURL = @"http://www.isophonics.net/datacollector/";
67 67
68 NSString *urls = [localServerURL stringByAppendingString:type]; 68 NSString *urls = [webServerURL stringByAppendingString:type];
69 NSURL *url = [NSURL URLWithString:urls]; 69 NSURL *url = [NSURL URLWithString:urls];
70 70
71 71
72 // request object 72 // request object
73 NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 73 NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
90 NSData* result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; 90 NSData* result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
91 91
92 NSString *responseDataString = [[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding]; 92 NSString *responseDataString = [[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding];
93 93
94 //NSString* responseDataString = [NSString stringWithUTF8String: ]; 94 //NSString* responseDataString = [NSString stringWithUTF8String: ];
95 NSLog(@"didRecieveDta %@", responseDataString); 95 NSLog(@"sync req. data %@", responseDataString);
96 [self.data appendData:result]; 96 [self.data appendData:result];
97 97
98 if([responseDataString isEqualToString:@"testConnection:OK"]){ 98 if([responseDataString isEqualToString:@"testConnection:OK"]){
99 99
100 eventLogger.testConnectionOK(); 100 eventLogger.testConnectionOK();