Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] server.close() callback never fires #144

Closed
rkeiii opened this issue Mar 14, 2022 · 3 comments
Closed

[iOS] server.close() callback never fires #144

rkeiii opened this issue Mar 14, 2022 · 3 comments
Labels
bug Something isn't working released

Comments

@rkeiii
Copy link

rkeiii commented Mar 14, 2022

Description

When providing a callback function to server.close() it works as expected on Android but on iOS (iOS Simulator iPhone 13 iOS 15.2) the callback never fires. Despite this when I check the socket is successfully unbound and the server is shutdown.

Steps to reproduce

The console.debug() statement below is never executed.

server.close(() => {
        console.debug('Local server finished shuting down');
      });

Current behavior

The TCP server shutdown is successful but the server.close() callback never fires.

Expected behavior

The server.close() callback should fire on iOS just as it does on Android.

Relevant information

OS iOS 15.2
react-native 0.66.3
react-native-tcp-socket 5.6.0
@rkeiii rkeiii added the bug Something isn't working label Mar 14, 2022
@Rapsssito
Copy link
Owner

@rkeiii, thanks for the feedback! I will release a fix ASAP

@nikos9413
Copy link

Hello, it does not work for me on Android. I'm calling server.close() and nothing happens. When I call it a second time, it crashes completely out of the app. The server instance I'm using is the correct one; I tested it with a server.getConnections() call.
Test devices are OnePlus 8 and Huawei P8 Lite. One is fairly new and the other is pretty old.

`"dependencies": {

"@react-native-community/netinfo": "^8.2.0",
"react": "17.0.2",
"react-native": "0.67.4",
"react-native-tcp-socket": "^5.6.2",
"readable-stream": "3.6.0",
"stream-browserify": "3.0.0"

},
"devDependencies": {

"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"@types/jest": "^26.0.23",
"@types/react-native": "^0.66.15",
"@types/react-test-renderer": "^17.0.1",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"babel-jest": "^26.6.3",
"eslint": "^7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2",
"rn-nodeify": "^10.3.0",
"typescript": "^4.4.4"

},`

github-actions bot pushed a commit that referenced this issue Aug 22, 2022
## [6.0.1](v6.0.0...v6.0.1) (2022-08-22)

### Bug Fixes

* Server never emits close event if no connections ([#156](#156)) ([6eec851](6eec851)), closes [#144](#144)
@github-actions
Copy link

🎉 This issue has been resolved in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

3 participants