naderio / nativescript-socket.io

Fully-featured Socket.IO client implementation for NativeScript
The Unlicense
48 stars 21 forks source link

Strange behavior between Android and iOS #38

Closed ngunhaSO closed 5 years ago

ngunhaSO commented 6 years ago

For android, after 5s or so, the socket is totally disconnected. And because of that, if i emit something from iOS, my android cannot receive any response. My backend server is in node.js with https

Everything works just fine in iOS, the socket remains open.

My package.json: "angular/core": "4.2.5", "nativescript-angular": "4.2.0", "nativescript-socket.io": "^0.9.0"

And tns version: "tns-android": { "version": "3.4.0" }, "tns-ios": { "version": "3.4.0" }

I have tried to add 'timeout' into the Option then the app crash silently. What are other available options to keep the socketio behave like iOS?

ngunhaSO commented 6 years ago

From the android client, when i observe the socket on 'error', it detects as the socketio has error but no exception being shown. Is it because of the mismatch version between Android socketio client and my nodejs server? My nodejs socket io version is: 2.0.4

By enable debug mode, i see from the console log is that: nativescript-socket.io on disconnect ["transport error"]. How could it be suddenly having transport error when it was connected intially?

ngunhaSO commented 6 years ago

Any suggestion for this issue?

dalsscarlon commented 6 years ago

Any updates???

naderio commented 6 years ago

@ngunhaSO @dalsscarlon I have similar setup functioning properly (nativescript-socket.io 0.9.0 with Socket.IO 2.1.1 on server via HTTPS) It could be server configuration. (@ngunhaSO check issue #46)