remove dead code

This commit is contained in:
blagoev 2017-11-13 09:24:52 +02:00
parent 5365e1bb13
commit e2c6a5f906
1 changed files with 0 additions and 31 deletions

View File

@ -88,7 +88,6 @@ extern "C" JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executo
#if DEBUG
GCDWebServer *_webServer;
std::unique_ptr<RPCServer> _rpcServer;
std::thread _workerThread;
#endif
}
@ -211,15 +210,6 @@ RCT_REMAP_METHOD(emit, emitEvent:(NSString *)eventName withObject:(id)object) {
return [ipAddresses copy];
}
static void
TimerCallback(CFRunLoopTimerRef timer, void *info)
{
RPCServer* rpcServer = (RPCServer*)info;
rpcServer->try_run_task();
done:
return;
}
- (void)startRPC {
[GCDWebServer setLogLevel:3];
_webServer = [[GCDWebServer alloc] init];
@ -260,27 +250,6 @@ done:
[response setValue:@"http://localhost:8081" forAdditionalHeader:@"Access-Control-Allow-Origin"];
return response;
}];
_workerThread = std::thread([&]() {
auto timerInterval = 0.5;
CFStringRef timerMode = CFSTR("TimerMode");
CFRunLoopTimerContext timerContext = { 0, NULL, NULL, NULL, NULL };
timerContext.info = &_rpcServer;
CFRunLoopTimerRef timerRef = CFRunLoopTimerCreate(kCFAllocatorDefault,
CFAbsoluteTimeGetCurrent() + timerInterval,
timerInterval,
0,
0,
TimerCallback,
&timerContext);
CFRunLoopAddTimer(CFRunLoopGetCurrent(), timerRef, timerMode);
CFRunLoopRunInMode(timerMode, 4, false);
CFRunLoopRun();
});
[_webServer startWithPort:WEB_SERVER_PORT bonjourName:nil];
return;