powered by Jive Software

XMPPBoshConnection fix : secure mode auto-set port?

Just a little thing I ran into while reading/using the XMPPBoshConnection class… It’s just my opinion of course

The secure property setter should not automatically set the port number property. I did not understand why XIFF was using a port number (7443) different from the one I set but after a few minutes, I saw that it was a default port that cannot be changed and most of all, is automatically updated when you are using this setter to set secure to true or false.

I think it’s not efficient to allow a property to be set in the constructor and with a setter as well as to use a setter silently when using another one

Makes perfect sense.

Can you provide a patch for this?

First patch I do using SVN… so I hope I did great

In the patch, I removed the secure setter, supposing the secure mode can be set only when constructing a XMPPBOSHConnection instance.

I changed the comment of the secure getter, just to be more logical with the changes.

And that’s all.

So when I use my instance, I specify the secure mode like this :

var xmppConn : XMPPBOSHConnection = new XMPPBOSHConnection(true);

xmppConn.port = 12443; // my https port

etc.
XMPPBOSHConnection.patch.zip (470 Bytes)

I think the “set” method is stil needed. Your comment included as it is a good description for this method.

Fix available in revision 11546.

I agree then But without the auto-call to the port setter…

As I can see it is on the last revision. Great