Giter Site home page Giter Site logo

Comments (8)

mremond avatar mremond commented on May 19, 2024 2

@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.

mremond avatar mremond commented on May 19, 2024 1

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.

mdosch avatar mdosch commented on May 19, 2024 1

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.

shrhdk avatar shrhdk commented on May 19, 2024

Client-to-Server Pings may help you.

https://xmpp.org/extensions/xep-0199.html#c2s

from go-xmpp.

mdosch avatar mdosch commented on May 19, 2024

thx, I'll try to implement a ping if there was no activity since ~5 minutes.

from go-xmpp.

mremond avatar mremond commented on May 19, 2024

@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.

mdosch avatar mdosch commented on May 19, 2024

from go-xmpp.

mdosch avatar mdosch commented on May 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.