Comments (4)
i've found the fix for this issue:
socketClient.openSocketWithURLRequest(request: NSURLRequest.initForWebsockets(),
delegate: self,
connectionHeaders: ["Authorization" : "Bearer xyz)", "heart-beat": "0,10000"])
The addition of the heart-beat header (as mentioned in ticket #18) has created consistent traffic over the web socket and hence keeps the socket open.
Thanks for your help, and great work with the library! 🙂🙃🙂
from stompclientlib.
Hello @DanielCreagh
From RFC 6455:
1001 indicates that an endpoint is "going away", such as a server
going down or a browser having navigated away from a page.
Resource: Stackoverflow
You should control the stompclient connection when changing the new ViewController or any kinds of stuff. Also, please check your server side part for connection refuse, timeout etc.. If your endpoint connection is goes down, normally your stream connection ends. Moreover, you should handle this issue as well. If you cannot find the solution, please write back :)
One more thing, please try another fully working stream server and let see if you encounter this issue again.
Have fun !
from stompclientlib.
We have Android and Web clients using same websockets server and neither have this issue. :-(
We are using a singleton instance of a web sockets controller that persists throughout entire execution of app, it isn't connected to any view controllers or anything that can be deallocated etc.
I've tried on device and on simulator on different networks and all demonstrate same behaviour.
Is there a way to configure ping/pong functionality?
from stompclientlib.
There is a ping/pong functionality but it still needs some work to do. Please check this issue: #18
from stompclientlib.
Related Issues (20)
- Subscribe response HOT 3
- How can I access http response header (handshakeResponseHeaders) about handshaking? HOT 1
- Disconnecting after using autoReconnect HOT 15
- Add openSocketWithURLRequest connectionheader to websocket urlRequest's HTTPHeaderField and request additional connect function. HOT 4
- Cannot connect to socket HOT 3
- Error Domain=SRWebSocketErrorDomain Code=2132 "received bad response code from server 403" HOT 4
- Add method/flag to stop logging HOT 6
- Subscribe Issue HOT 3
- Version 2.0 HOT 12
- Received bad response code from server 403 HOT 4
- Error Domain=SRWebSocketErrorDomain Code=2132 "received bad response code from server 403" HOT 3
- Socket Disconnect after 30 min HOT 5
- misprint in code HOT 3
- Support for WatchOS HOT 2
- Swift Package Manager support? HOT 2
- Connection variable is not set to false when WebSocket receives DISCONNECT HOT 1
- Auto disconnection with error code 4500 HOT 2
- Facing Issue while sending the message HOT 1
- Privacy Manifest HOT 6
- Adding response after sent to server or not HOT 7
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 stompclientlib.