facebookincubator / SocketRocket

A conforming Objective-C WebSocket client library.
Other
9.56k stars 2.01k forks source link

why error code:2145 #494

Open jinjuezhou opened 7 years ago

jinjuezhou commented 7 years ago

hi, I got the error message: (didFailWithError),error:Error Domain=SRWebSocketErrorDomain Code=2145 "Error writing to stream" UserInfo={NSLocalizedDescription=Error writing to stream} but don't know why

NathanLi commented 7 years ago

The NSOutputStream write failed.

You can debug to _outputStream, it's streamError property contains details information.

Or The delegate method - (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error;.

The error's userInfo, the key NSUnderlyingErrorKey also contains details information.