ConnectionConfiguration config = new ConnectionConfiguration(
"192.168.8.158", 5222);
XMPPConnection connection = new XMPPTCPConnection(config);
try {
connection.connect(); // Throw SmackException$NoReponseException here.
} catch (SmackException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The openfire just use the default settings, and I can use Spark to connect the server.
But if I add the code like this:
config.setSecurityMode(SecurityMode.disabled);
the app connected to the server.But why can't I useSecurityMode.enabled?