react-native/Libraries/WebSocket
Zack 025281230d WebSocket: call onclose before closing in event of error
Summary:Motivation: Developer expects `onclose` to be called before/during close of the websocket. The `websocketFailed` event triggers a close but does not invoke onclose.

Testplan: Connect to a websocket server from android, terminate the server, observe that onerror is called, the websocket is closed, but onclose is not called.

Note: the observed bug is in android only because in iOS the underlying websocket implementation fires the `websocketClosed` rather than `websocketFailed` event when the server terminates. Nevertheless, the justification for this change stands that regardless of the cause of the close, if `this.close` is called it is expected this.onclose should be called as well.
Closes https://github.com/facebook/react-native/pull/6307

Differential Revision: D3017458

fb-gh-sync-id: c9e2dfefa597b4e99ee85eaa991667c347f86d83
shipit-source-id: c9e2dfefa597b4e99ee85eaa991667c347f86d83
2016-03-06 15:02:27 -08:00
..
RCTWebSocket.xcodeproj Fix OSS iOS build 2016-02-17 07:38:33 -08:00
__mocks__ Fix tests related to event-target-shim 2015-10-02 12:36:23 -07:00
__tests__ Fixes #3846 2015-11-06 11:24:29 -08:00
RCTSRWebSocket.h Added an optional options parameter for WebSockets 2016-01-20 11:01:39 -08:00
RCTSRWebSocket.m iOS websocket: include cookies with request 2016-02-01 14:19:32 -08:00
RCTWebSocketExecutor.h Refactored module access to allow for lazy loading 2015-11-25 04:49:45 -08:00
RCTWebSocketExecutor.m Improve Chrome debugger 2016-02-05 15:17:33 -08:00
RCTWebSocketManager.h Enable persistent socket between packager and bridge (1/N). 2016-02-16 23:05:36 -08:00
RCTWebSocketManager.m Enable persistent socket between packager and bridge (1/N). 2016-02-16 23:05:36 -08:00
RCTWebSocketModule.h Make the RCTSRWebSocketDelegate protocol part of RCTWebSocketModule public 2016-01-14 16:13:33 -08:00
RCTWebSocketModule.m Added an optional options parameter for WebSockets 2016-01-20 11:01:39 -08:00
WebSocket.js WebSocket: call onclose before closing in event of error 2016-03-06 15:02:27 -08:00
WebSocketBase.js Annotate WebSocket with Flow 2016-02-16 03:29:52 -08:00
WebSocketEvent.js Implement WebSocket module for Android. Fixes #2837 2015-10-07 08:36:22 -07:00