Skip to content

Commit

Permalink
Use kCFRunLoopCommonModes
Browse files Browse the repository at this point in the history
  • Loading branch information
cxa committed Apr 12, 2017
1 parent a179fa5 commit 5c46ddd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PocketSocket/PSWebSocketServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ - (void)connect:(BOOL)silent {
_socketRunLoopSource = CFSocketCreateRunLoopSource(kCFAllocatorDefault, _socket, 0);

CFRunLoopRef runLoop = [[self runLoop] getCFRunLoop];
CFRunLoopAddSource(runLoop, _socketRunLoopSource, kCFRunLoopDefaultMode);
CFRunLoopAddSource(runLoop, _socketRunLoopSource, kCFRunLoopCommonModes);

_running = YES;

Expand Down Expand Up @@ -218,7 +218,7 @@ - (void)disconnectGracefully:(BOOL)silent {
- (void)disconnect:(BOOL)silent {
if(_socketRunLoopSource) {
CFRunLoopRef runLoop = [[self runLoop] getCFRunLoop];
CFRunLoopRemoveSource(runLoop, _socketRunLoopSource, kCFRunLoopDefaultMode);
CFRunLoopRemoveSource(runLoop, _socketRunLoopSource, kCFRunLoopCommonModes);
CFRelease(_socketRunLoopSource);
_socketRunLoopSource = nil;
}
Expand Down

0 comments on commit 5c46ddd

Please sign in to comment.