Comments (12)
The connection shutdown at the time and then reconnected!
from sockette.
What do your event hooks look like? Sockette will terminate if it received 1000 or 1005 code. So I'm thinking there's something inside the event hooks that's preventing that.
from sockette.
I got the same issue. Calling close() doesn't seem to close the connection.
from sockette.
Can you guys try forcing a 1000
code during close?
ws.close(1000)
Also, please let me know what browsers & platforms you are/were experiencing this issue.
Thanks!
from sockette.
I'm experiencing the same issue on firefox in my react app.
The websocket object closes with code 1006 even when adding
ws.close(1000)
and then it will reconnect.
Also, on 2.0.3 I get unsupported operation error when using the close method
from sockette.
Thanks, interesting
Are you at all able to post a snippet or reproduction so that I can dig into it? Would love to squash this lingering issue
from sockette.
Got the same issue with react-native. It will automatically reconnect. @lukeed Do you have any experience with react native? I could provide a minimal setup to run in the ios simulator.
from sockette.
Sure, thank you. I only hear of this issue with RN, so it seems to be specific to that.
I'll poke thru the repro when you have it :) Thanks
from sockette.
Sorry for not providing some code... I had a quick look myself right now and it looks like the error code is always 1001, which is not handled in the onclose handler, so it is calling reconnect again.
1001 indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page.
1001 is even happening if I do ws.close(1005)
. Very strange.
from sockette.
@lukeed any chance the PR related to this issue gets merged?
Many thanks in advance!
from sockette.
I'have reverse problem.
With AWS API gateway the connection as gone away after 10 minutes, Sockette receive 1001 code and does not reconnect ... !
from sockette.
@maxime-guyot sounds like a keep-alive problem. Clients should be pinging the service on an interval shorter than what the server is configured for, or the load balancer in your case.
1001 means something is going away, it doesn't specify client or server. And since every browser will disconnect with a 1001 code when navigating away from the current page, Sockette I can't keep trying to reconnect (since user left)
It's basically a matter of not handling client cleanup correctly versus the server cleaning up idle connections. Sockette can't do both, so it helps out by cleaning up after you and ensuring the client terminates correctly.
from sockette.
Related Issues (20)
- Disable reconnect programmatically HOT 15
- Access underlying socket object HOT 3
- SCRIPT5022: SecurityError in IE11 HOT 1
- onerror not returning code HOT 2
- ws.close should clear pending setTimeout HOT 1
- Still in CONNECTING state HOT 1
- Still reconnecting after close() HOT 5
- didunmount
- Bump npm version to include #48 HOT 1
- Able to detect network lost? HOT 1
- Possible to get WebSocket instance? HOT 1
- How to get error code HOT 1
- When I close the connection, it doesn't send queryStringParameters HOT 1
- Socket connection code choices HOT 2
- [Feature] Ability to set url before reconnecting HOT 1
- Automatically split & re-combine messages over a certain size HOT 5
- Increment timeout HOT 2
- Sockette.close can unexpectedly clear other timeouts/intervals
- project status? HOT 2
- Put an option to always reconnect, no matter what
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sockette.