XMPP Plus

Questions and comments specific to a particular plugin should go here.
HTPCanwender
Experienced User
Posts: 59
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: XMPP Plus

Post by HTPCanwender » Thu Jul 05, 2018 9:46 pm

The servers jabber.de and jabber.hot-chilli.net are for free. They both are located in Germany. You can create an account at their web sites. I have no time to test anything in the next 3 days. I will tell you, if I have any new information.

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XMPP Plus

Post by kgschlosser » Fri Jul 06, 2018 4:55 am

OK cool. this is what i needed to start off with.

@ Snowbird

what xmpp server do you use..
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XMPP Plus

Post by kgschlosser » Fri Jul 06, 2018 5:59 am

ok so from what i have been reading.... Now i do not know a whole heap ton about this xmpp stuff. But the servers jabber.de and jabber.hot-chilli.net are not correct servers to connect to..

jabber.de does not have an XMPP gateway..
and jabber.hot-chilli.net you should be connecting one of the following.
j2j.jabber.hot-chilli.net
gg.jabber.hot-chilli.net
xmpp.jabber.hot-chilli.net

the root servers that you provided are for PEP connections. which there is no plugin created for sleekxmpp

I also tried connecting to the jabber.de and I have no been able to connect. it states the server cannot be located. at the same time their webserver was no longer accessible. I wonder if they are having server issues. I did found an older report of them having issues with ipv6 support. so try disabling ipv6 on the machine running EG and see if that is the possible cause.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 360
Joined: Fri Jul 03, 2009 10:04 am

Re: XMPP Plus

Post by Snowbird » Fri Jul 06, 2018 12:17 pm

kgschlosser wrote:
Fri Jul 06, 2018 4:55 am
@ Snowbird

what xmpp server do you use..
I use this free server :
https://404.city/
you can create an account from their website.

Snowbird
Experienced User
Posts: 360
Joined: Fri Jul 03, 2009 10:04 am

Re: XMPP Plus

Post by Snowbird » Fri Jul 06, 2018 12:23 pm

kgschlosser wrote:
Thu Jul 05, 2018 8:53 pm
it could be that the API standards for something have changed and the servers accounted for the change and the authors of some of the code that is being used has not updated I know there is a fix for an issue with the library SleekXMPP that has been requested to be added for almost a year now and it has not been done. This kind of tells us that the author is no longer maintaining the code. we have to isolate exactly the bit that is causing the problem. because I am using code written by someone else there is going to be a learning curve to figure out what is going on.
A while ago I posted something interesting, you might read it again :
viewtopic.php?f=9&t=10068&p=50515#p50515
It's a fork of sleekxmpp called "slixmpp", and this one seems to be more maintained.

Some explanations here might help you :
https://blog.louiz.org/slixmpp

It seems that sleekxmpp has some limitations regarding threads usage to open/close/read/write to a socket.

Snowbird
Experienced User
Posts: 360
Joined: Fri Jul 03, 2009 10:04 am

Re: XMPP Plus

Post by Snowbird » Mon Jul 09, 2018 6:49 pm

Kevin,

I may have found a way for you to replicate the issue, it's very easy, while connected to a working xmpp server, from your computer try to connect to a remote server through VPN to use its internet connection instead of yours, and you will see the problem right away !
09/07 20:38:04 XMPPPlus.meee@404.city.SessionEnded
09/07 20:38:04 XMPPPlus.www.404.city:5222.SocketError '[Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'
09/07 20:38:04 XMPPPlus.www.404.city:5222.SocketError '[Errno 9] Bad file descriptor'
09/07 20:38:04 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:38:08 XMPPPlus.meee@404.city.SessionEnded
09/07 20:38:12 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:38:12 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:38:12 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:38:21 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:38:21 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:38:21 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:38:29 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:39:02 Exception in thread Thread-37:
09/07 20:39:02 Traceback (most recent call last):
09/07 20:39:02 File "threading.pyc", line 801, in __bootstrap_inner
09/07 20:39:02 File "threading.pyc", line 754, in run
09/07 20:39:02 File "C:\ProgramData\EventGhost\plugins\XMPPPlus\__init__.py", line 267, in _connect
09/07 20:39:02 self._client['xep_0184'].auto_ack = False
09/07 20:39:02 AttributeError: 'bool' object has no attribute 'auto_ack'
09/07 20:39:02
09/07 20:39:02 XMPPPlus.meee@404.city.ConnectionFailed.Retrying
09/07 20:39:15 XMPPPlus.www.404.city:5222.SocketError '[Errno 9] Bad file descriptor'
09/07 20:39:24 XMPPPlus.www.404.city:5222.SocketError '[Errno 9] Bad file descriptor'
09/07 20:39:24 Unhandled exception in thread started by <bound method Thread.__bootstrap of <Thread(send_thread, stopped 18728)>>
09/07 20:39:24 Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
09/07 20:39:24 File "threading.pyc", line 774, in __bootstrap
09/07 20:39:24 File "threading.pyc", line 789, in __bootstrap_inner
09/07 20:39:24 KeyError: <Thread(send_thread, stopped 18728)>
09/07 20:39:32 XMPPPlus.www.404.city:5222.SocketError '[Errno 9] Bad file descriptor'
09/07 20:39:32 XMPPPlus.meee@404.city.ConnectionFailed.Retrying

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XMPP Plus

Post by kgschlosser » Mon Jul 09, 2018 7:24 pm

Is this a real world use? Is this when these problems are happening to you?

I didn't write the SleekXMPP library. it's got a lot of voodoo code in it. and as it seems the author is no longer supporting it. and any alternative that is being maintained is written in python and is also written in such a way that it would have to be re written to make it work in python 2.

The author of SleekXMPP didn't take into consideration threads when he/she wrote it. this is one of the things that could be causing a problem. he/she also didn't take into consideration the possibility of a network connection changing. Now i can reconnect the thing but if the socket is bound to the wrong NIC (which it would be if you start a VPN connection) and this is something that does not get redone when a connection attempt is made it will cause a problem.


I will have to leek at the code to see if there is something that i can do that would fix the issue easily. it will be a while before I am able to get around to doing a major overhaul of the thing to make it work.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 360
Joined: Fri Jul 03, 2009 10:04 am

Re: XMPP Plus

Post by Snowbird » Mon Jul 09, 2018 10:01 pm

kgschlosser wrote:
Mon Jul 09, 2018 7:24 pm
Is this a real world use? Is this when these problems are happening to you?
what do you think ? :) of course, or else why would I bother to request a fix for something I don't use ? :P
kgschlosser wrote:
Mon Jul 09, 2018 7:24 pm
I didn't write the SleekXMPP library. it's got a lot of voodoo code in it. and as it seems the author is no longer supporting it. and any alternative that is being maintained is written in python and is also written in such a way that it would have to be re written to make it work in python 2.
I know, it's written in python 3.x that's why I didn't insist about it in the first place, just forget I mentioned it, I only thought that you could find some interesting info in there, BTW, have you read this page : https://blog.louiz.org/slixmpp ?
kgschlosser wrote:
Mon Jul 09, 2018 7:24 pm
The author of SleekXMPP didn't take into consideration threads when he/she wrote it. this is one of the things that could be causing a problem. he/she also didn't take into consideration the possibility of a network connection changing. Now i can reconnect the thing but if the socket is bound to the wrong NIC (which it would be if you start a VPN connection) and this is something that does not get redone when a connection attempt is made it will cause a problem.
well, probably that he forgot some essential things regarding network connection change, it would be interesting to test a connection change from WLAN to LAN, or even from WLAN to WAN (I can't try this myself right now, maybe tomorrow). On the other hand, when in WLAN mode, switching from one access point to another works fine and seamlessly, so there is some mechanism already that is able to reconnect even in case of a network change.
kgschlosser wrote:
Mon Jul 09, 2018 7:24 pm
I will have to leek at the code to see if there is something that i can do that would fix the issue easily. it will be a while before I am able to get around to doing a major overhaul of the thing to make it work.
It would be fine if you can fix this final thing, I know you have done a lot already for this plugin... be assured it works fine in everyday use, and I use it everyday ! :) as long as you are in a "normal" situation there's nothing wrong with it, we're asking for the icing on the cake ;) I like complete things that you can rely on in every situation, I'm sure you feel the same way ;)

Thank you !!

Snowbird
Experienced User
Posts: 360
Joined: Fri Jul 03, 2009 10:04 am

Re: XMPP Plus

Post by Snowbird » Tue Jul 10, 2018 6:32 am

I have found a workaround :
- I first disable the XMPP plugin
- then connect to the VPN server
- then start the XMPP plugin

The only problem with this workaround is when the vpn connection is dropped (it happens sometimes), and in this case I have the same problem as before, I need to restart EG to be back in a working state.

Maybe if you can find a way to detect a connection change, you could disable the plugin until the connection is completed, then enable it ? I know it's not the best thing to do, but at least you won't need to understand all the voodoo code :)

By the way, when I disable the plugin, why do I still receive these errors :
10/07 08:35:43 XMPPPlus.x201@404.city.ConnectionFailed.Retrying
10/07 08:35:43 XMPPPlus.www.404.city:5222.SocketError '[Errno 9] Bad file descriptor'
10/07 08:35:44 XMPPPlus.x201@404.city.SessionEnded
10/07 08:35:48 XMPPPlus.x201@404.city.ConnectionFailed.Retrying
10/07 08:36:01 XMPPPlus.www.404.city:5222.SocketError '[Errno 9] Bad file descriptor'
10/07 08:36:09 XMPPPlus.www.404.city:5222.SocketError '[Errno 9] Bad file descriptor'
10/07 08:36:09 XMPPPlus.x201@404.city.ConnectionFailed.Retrying
shouldn't it stop completely the connection attempts ?

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XMPP Plus

Post by kgschlosser » Tue Jul 10, 2018 7:59 am

yessum they should stop trying to connect.


what I am going to do is I am going to have to find out where they are hiding the socket creation bits and override that portion of the code so this way every time a new /retry connection is made it will reset the whole socket


what I am saying is this.

you will see there some where's in the sleekxmpp package

Code: Select all

self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

but then this completely elsewhere

Code: Select all

self.sock.connect((address, port))

and yet another chunk elsewhere

Code: Select all

self.sock.sendall(data)

or something long those lines..

the issue is the first code block is being created the first time sleek xmpp gets imported. and it never again gets updated

and when either a connect or reconnect is attempted then the second code block gets called. it keeps on using the data that is contained in the original socket creation. so if you change network settings all the old data simply sits there.


the reason why if you change Access points it keeps on trucking right along. Is because nothing has changed on your network. You still have the same IP same DNS servers, same routing tables, same default gateway. it only changed the physical connection not the logical one. the issue is when a logical change gets made


Think of a 2" pipe which would represent your NIC card and then a 1.75" pipe inside of that which represents the VPN. A VPN connection is a Network card on your PC that has an IP address that allows for access to the network connection on the other end of the VPN. So when a VPN connection is made the binding orders change. and the VPN gets put first in line. and it then becomes the default gateway. and the old default gateway gets put on standby.

You do have the ability to route traffic between the 2 networks. because if this thing bombing like it is I am assuming that the VPN is currently not set up to do this. Meaning that when you connect the VPN it is only for a single machine and not your whole network.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XMPP Plus

Post by kgschlosser » Tue Jul 10, 2018 6:02 pm

OK I think I may have a fix for the issue.

I have been working on this quite a bit and the author at least had the foresight to add a mechanism where we can bypass having sleekxmpp handle the socket end of things. the author has all kinds of really complex and to be honest really necessary and goofy mechanisms in place for creating/connecting the socket. when dealing with sockets K.I.S.S. (Keep It Stupid Simple, or Keep It Simple Stupid, the latter is what applies most times.) method is the way to go. there is this whole thing where he has a class from a completely different module that is set up and a function is called in that class that doubles back to call a function in the originating class that in turn goes back and calls a function in that other class. it's like playing ping pong just to get the thing to connect never mind even creating the socket which is a series sub classed sub classes. only one word i can come up with for this is retarded. some time i wish i could reach through a computer monitor and do what my mom used to do with me.. crack the person upside the head.

I uninstalled openfire xmpp server a while ago. so i am going to wing it with this one. and hope there are no errors and pas it of to you guys.. that will be later today.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 360
Joined: Fri Jul 03, 2009 10:04 am

Re: XMPP Plus

Post by Snowbird » Tue Jul 10, 2018 7:12 pm

Ok, sounds great, thanks for the effort! Hope your fix will do the trick, all this seems soooo complicated...

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XMPP Plus

Post by kgschlosser » Wed Jul 11, 2018 1:13 am

its not really all that complicated. in you case it's because you have the network cars that are dynamically changing. We don't have anything made for EG as of yet that will give us some kind of an event for network properties changing. I will have to look into the windows API o see if there is some kind of a notification for this. Otherwise we would have to do a polling loop which is something I would like to try and avoid.

But if this works I will be happy as well. i need a few more hours to get the code cleaned up and i will make sure it can at the very least connect to a server
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 360
Joined: Fri Jul 03, 2009 10:04 am

Re: XMPP Plus

Post by Snowbird » Wed Jul 11, 2018 11:20 am

Hi, can you tell me what XEP are enabled so far in the plugin ? (is there a way to display them in the pane when the plugin starts ?).

I've found some information that might be useful, it's about the XEP-0198 implementation :
"Stream Management allows XMPP to survive small network outages and changes of the underlying TCP connection."

What do you think about this XEP ? More readings here :
https://xmpp.org/extensions/xep-0198.html

HTPCanwender
Experienced User
Posts: 59
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: XMPP Plus

Post by HTPCanwender » Thu Jul 19, 2018 2:38 pm

I have installed openfire on the same PC as eg. In this configuration the connection between openfire and eg is stable.

Post Reply