Skip to content

Commit

Permalink
Merge pull request #1 from naartjie/fixes/226
Browse files Browse the repository at this point in the history
fix facebookincubator#226: rename _connect / _disconnect pair to connect / disconnect
  • Loading branch information
tkopczuk committed May 12, 2015
2 parents d1e796c + fd6d17b commit 2657e79
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions SocketRocket/SRWebSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,11 @@ - (void)_writeData:(NSData *)data;
- (void)_closeWithProtocolError:(NSString *)message;
- (void)_failWithError:(NSError *)error;

- (void)_disconnect;

- (void)_readFrameNew;
- (void)_readFrameContinue;

- (void)_pumpScanner;

- (void)_pumpWriting;

- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback;
Expand All @@ -203,7 +201,9 @@ - (BOOL)_checkHandshake:(CFHTTPMessageRef)httpMessage;
- (void)_SR_commonInit;

- (void)_initializeStreams;
- (void)_connect;

- (void)disconnect;
- (void)connect;

@property (nonatomic) SRReadyState readyState;

Expand Down Expand Up @@ -399,7 +399,7 @@ - (void)open;

_selfRetain = self;

[self _connect];
[self connect];
}

// Calls block on delegate queue
Expand Down Expand Up @@ -588,7 +588,7 @@ - (void)_initializeStreams;
_outputStream.delegate = self;
}

- (void)_connect;
- (void)connect;
{
if (!_scheduledRunloops.count) {
[self scheduleInRunLoop:[NSRunLoop SR_networkRunLoop] forMode:NSDefaultRunLoopMode];
Expand Down Expand Up @@ -635,7 +635,7 @@ - (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;
SRFastLog(@"Closing with code %d reason %@", code, reason);

if (wasConnecting) {
[self _disconnect];
[self disconnect];
return;
}

Expand Down Expand Up @@ -672,7 +672,7 @@ - (void)_closeWithProtocolError:(NSString *)message;
[self _performDelegateBlock:^{
[self closeWithCode:SRStatusCodeProtocolError reason:message];
dispatch_async(_workQueue, ^{
[self _disconnect];
[self disconnect];
});
}];
}
Expand All @@ -693,7 +693,7 @@ - (void)_failWithError:(NSError *)error;

SRFastLog(@"Failing with error %@", error.localizedDescription);

[self _disconnect];
[self disconnect];
}
});
}
Expand Down Expand Up @@ -835,11 +835,11 @@ - (void)handleCloseWithData:(NSData *)data;
[self closeWithCode:1000 reason:nil];
}
dispatch_async(_workQueue, ^{
[self _disconnect];
[self disconnect];
});
}

- (void)_disconnect;
- (void)disconnect;
{
[self assertOnWorkQueue];
SRFastLog(@"Trying to disconnect");
Expand All @@ -866,7 +866,7 @@ - (void)_handleFrameWithData:(NSData *)frameData opCode:(NSInteger)opcode;
if (str == nil && frameData) {
[self closeWithCode:SRStatusCodeInvalidUTF8 reason:@"Text frames must be valid UTF-8"];
dispatch_async(_workQueue, ^{
[self _disconnect];
[self disconnect];
});

return;
Expand Down Expand Up @@ -1257,7 +1257,7 @@ - (BOOL)_innerPumpScanner {
if (valid_utf8_size == -1) {
[self closeWithCode:SRStatusCodeInvalidUTF8 reason:@"Text frames must be valid UTF-8"];
dispatch_async(_workQueue, ^{
[self _disconnect];
[self disconnect];
});
return didWork;
} else {
Expand Down

0 comments on commit 2657e79

Please sign in to comment.