SocketRocket icon indicating copy to clipboard operation
SocketRocket copied to clipboard

SRStatusCode 4001 use by applications not callback to application

Open chenxm2 opened this issue 6 years ago • 3 comments

My Server close the socket with code 4001. Then I receive it on - (void)handleCloseWithData:(NSData *)data function。But, I get the code SRStatusCodeGoingAway 1001。 And I found that (dispatch_data_get_size(_outputBuffer) - _outputBufferOffset) != 0 in the Call stack handleCloseWithData->closeConnection->_pumpWriting。Then the real _closeCode 4001 missed。 How can I fix this。

chenxm2 avatar Jul 23 '18 08:07 chenxm2

i get the same problem too. Who can give me a solution.

tantan39 avatar Oct 09 '18 04:10 tantan39

Got the same problem. I'm attempting to close socket with code 3501 (using method -(void)closeWithCode:reason:), but I got a 1005 code instead in - (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(nullable NSString *)reason wasClean:(BOOL)wasClean;.

Why the code we pass is getting lost during the closing?

YuryBogdanov avatar Oct 19 '18 11:10 YuryBogdanov

I found the reason is my server.

tantan39 avatar Oct 19 '18 11:10 tantan39