Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't phone home to a random server #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 1 addition & 39 deletions src/ios/SocketsForCordova/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,45 +51,7 @@ - (id)init
// 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