Private
Public Access
1
0

Updates to sending and message sequences

This commit is contained in:
James Magahern
2018-11-20 19:57:35 -07:00
parent ddec4be8d6
commit 4f5cd058c5
17 changed files with 264 additions and 45 deletions

View File

@@ -36,17 +36,26 @@
NSURL *url = [NSURL URLWithString:path];
NSString *endpointName = [url lastPathComponent];
BOOL requestTimedOut = NO;
Class operationClass = [MBIMBridgeOperation operationClassForEndpointName:endpointName];
if (operationClass != nil) {
_currentOperation = [[operationClass alloc] initWithRequestURL:url completion:completion];
_currentOperation.requestBodyData = _bodyData;
[[[MBIMBridge sharedInstance] operationQueue] addOperation:_currentOperation];
dispatch_semaphore_wait(sema, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(60.0 * NSEC_PER_SEC)));
long status = dispatch_semaphore_wait(sema, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(60.0 * NSEC_PER_SEC)));
if (status != 0) {
requestTimedOut = YES;
}
} else {
response = [[HTTPErrorResponse alloc] initWithErrorCode:404];
}
if (requestTimedOut) {
response = [_currentOperation cancelAndReturnTimeoutResponse];
}
return response;
}