Skip to content

Commit 9917869

Browse files
Not sending messages to closed websocket connections (#99)
I believe this should be a safe change since the timer function nop is only ever run after the websocket is initialized. This works around potential issues in the websocket layer after we close the connection and hopefully addresses https://b.corp.google.com/issues/62363018x
1 parent 0297375 commit 9917869

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Firebase/Database/Realtime/FWebSocketConnection.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ - (void) send:(NSDictionary *)dictionary {
163163
}
164164

165165
- (void) nop:(NSTimer *)timer {
166-
if(self.webSocket) {
166+
if (!isClosed) {
167167
FFLog(@"I-RDB083004", @"(wsc:%@) nop", self.connectionId);
168168
[self.webSocket send:@"0"];
169169
}

0 commit comments

Comments
 (0)