-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Closed
Labels
BugPlatform: AndroidAndroid applications.Android applications.Resolution: FixedA PR that fixes this issue has been merged.A PR that fixes this issue has been merged.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
Websocket connection closed by server will not trigger onclose callback.
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 7.10.1
Yarn: Not Found
npm: 5.7.1
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 2.3 AI-162.3871768
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: ^0.53.0 => 0.53.0
For websocket server-side, I use ratchetPHP
Steps to Reproduce
connect = () => { this.ws = new WebSocket('URL') this.ws.onmessage = (e) => { json = JSON.parse(e.data) console.log(json) } this.ws.onclose = (e) => { console.log('closed') } } componentWillReceiveProps(nextProps){ this.connect() }
Then close the connection on server.
Expected Behavior
onclose function should be called.
Actual Behavior
When building in Android,
close request send from client will trigger the onclose function,
but RN can't detect a connection closed by server.
lll000111, arma7x and ssztemberg
Metadata
Metadata
Assignees
Labels
BugPlatform: AndroidAndroid applications.Android applications.Resolution: FixedA PR that fixes this issue has been merged.A PR that fixes this issue has been merged.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.