Comments (8)
@mdosch Sorry it took so long, but I am finally working on the disconnect detection and adding some way to trigger reconnect.
from go-xmpp.
Ping is a bit heavy on the server. Some servers (like ejabberd on SaaS) support whitespace ping.
I will try to add this method (whitespace ping) when I have some time to work on go-xmpp.
from go-xmpp.
This is the output from one of my bots in journalctl:
Jul 04 12:39:23 v220191283267104968 gowttr[26540]: 2020/07/04 12:39:23 unknown namespace urn:ietf:params:xml:ns:xmpp-streams <not-well-formed/>
Jul 04 12:39:38 v220191283267104968 gowttr[26540]: 2020/07/04 12:39:38 NextStart read tcp 127.0.0.1:39290->127.0.0.1:5222: use of closed network connection
Jul 04 12:39:53 v220191283267104968 gowttr[26540]: 2020/07/04 12:39:53 NextStart read tcp 127.0.0.1:39324->127.0.0.1:5222: read: connection reset by peer
Jul 04 12:39:53 v220191283267104968 gowttr[26540]: 2020/07/04 12:39:53 unknown namespace urn:ietf:params:xml:ns:xmpp-streams <not-well-formed/>
Jul 04 12:40:08 v220191283267104968 gowttr[26540]: 2020/07/04 12:40:08 stream error: system-shutdown
Jul 04 12:40:08 v220191283267104968 gowttr[26540]: 2020/07/04 12:40:08 unknown namespace urn:ietf:params:xml:ns:xmpp-streams <not-well-formed/>
Jul 04 12:40:08 v220191283267104968 gowttr[26540]: 2020/07/04 12:40:08 NextStart read tcp 127.0.0.1:39414->127.0.0.1:5222: use of closed network connection
Jul 04 12:40:23 v220191283267104968 gowttr[26540]: 2020/07/04 12:40:23 unknown namespace urn:ietf:params:xml:ns:xmpp-streams <not-well-formed/>
Jul 04 12:40:23 v220191283267104968 gowttr[26540]: 2020/07/04 12:40:23 NextStart read tcp 127.0.0.1:39516->127.0.0.1:5222: use of closed network connection
Jul 04 12:40:23 v220191283267104968 gowttr[26540]: 2020/07/04 12:40:23 NextStart read tcp 127.0.0.1:39520->127.0.0.1:5222: use of closed network connection
Jul 04 12:40:23 v220191283267104968 gowttr[26540]: 2020/07/04 12:40:23 unknown namespace urn:ietf:params:xml:ns:xmpp-streams <not-well-formed/>
from go-xmpp.
Client-to-Server Pings may help you.
https://xmpp.org/extensions/xep-0199.html#c2s
from go-xmpp.
thx, I'll try to implement a ping if there was no activity since ~5 minutes.
from go-xmpp.
@mdosch I think the new ClientManager should do what you need. It reconnects automatically when the connection is lost.
You can check how to use it in the xmpp_echo example: https://github.com/FluuxIO/go-xmpp/blob/master/cmd/xmpp_echo/xmpp_echo.go
I guess we can close this ticket now. You can also monitor progress on connection loss detection that will add an active way to detect connection loss: #35
from go-xmpp.
from go-xmpp.
Although I am using the StreamManager as in your echo bot example, see here it seems to still not work properly.
Whenever I restart my prosody the bot seems to not reconnect as it doesn't reply anymore. Do I need to configure more than shown in the echo bot example?
from go-xmpp.
Related Issues (20)
- SIGSEGV in xmpp_component example with Prosody HOT 1
- Implementation of stanza acknowledgement (XEP-0198) HOT 2
- PubSub stanza should be more generic HOT 1
- Improve error handling HOT 1
- Make keepalive configurable
- Add support for roster IQ stanzas HOT 4
- Support Message Archive Management (XEP-0313)
- Support XEP-0199: Reply to client or server initiated Ping
- Prosody & "echo" demo: not receiving any messages HOT 8
- XEP-0045: Cannot distinguish between empty subject and no subject HOT 1
- XEP-0045: Presences and messages arriving out of order; clients can interpret room join as complete before all `<presence/>`s landed
- stanza.Err makes 'code' non-optional
- Golang XML vulnerabilities HOT 3
- Cannot connect FluuxIO to MongooseIM
- "Echo" example from README should following RFC6121
- panic in session
- (stanza.IQ).MakeError: On including sender XML
- 【FEATURE】implementing ANONYMOUS auth mechanism ?
- InitialPresence should not be a constant
- GetDecoder() on an XMPP transport is called before Connect() HOT 2
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 go-xmpp.