Skip to content

Commit

Permalink
Removed code that appears to make a request to some random IP address
Browse files Browse the repository at this point in the history
  • Loading branch information
chill117 committed Apr 30, 2019
1 parent 1d70784 commit acab715
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/ios/SocketsForCordova/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,51 +45,6 @@ - (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
- (id)init
{
self = [super init];
if (self) {
// Uncomment to override the CDVCommandDelegateImpl used
// _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self];
// Uncomment to override the CDVCommandQueue used
// _commandQueue = [[MainCommandQueue alloc] initWithViewController:self];
}



NSLog(@"!!!!!!!!!!BEGIN TEST!!!!!!!");

self.socketAdapter = [[SocketAdapter alloc] init];

self.socketAdapter.dataConsumer = ^ void (NSArray* dataArray) {

NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dataArray
options:NSJSONWritingPrettyPrinted error:nil];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

NSLog(@"bytes read: %@", jsonString);
};
self.socketAdapter.closeEventHandler = ^ void (BOOL hasErrors) {
NSLog(@"socket closed");
};
self.socketAdapter.errorHandler = ^ void (NSString *error){
NSLog(@"socket error: %@", error);
};

[self.socketAdapter connect:@"69.36.243.188" port:[NSNumber numberWithInt:5000]];


NSData* dataJson = [@"[1,2,3,10]" dataUsingEncoding:NSUTF8StringEncoding];

NSError *e = nil;
NSArray *dataBuffer = [NSJSONSerialization JSONObjectWithData:dataJson options:NSJSONReadingMutableContainers error:&e];


[self.socketAdapter write:dataBuffer];



NSLog(@"!!!!!!!!!!END TEST!!!!!!!");



return self;
}

Expand Down

0 comments on commit acab715

Please sign in to comment.