Я пытаюсь использовать asmack 18 для подключения к серверу gtlak для подключения XMPP.
public static final String HOST = "talk.google.com";
public static final int PORT = 5222;
public static final String SERVICE = "gmail.com";
ConnectionConfiguration connConfig = new ConnectionConfiguration(HOST, PORT, SERVICE);
XMPPConnection connection = new XMPPConnection(connConfig);
try {
//Connect to the server
connection.connect();
connection.login("[email protected]", "password");
// Set the status to available
Presence presence = new Presence(Presence.Type.available);
connection.sendPacket(presence);
//xmppClient.setConnection(connection);
Log.d("connection","connection successfull");
} catch (XMPPException ex) {
connection = null;
Log.d("connection","connection fail");
//Unable to connect to server
}
Но выдает ошибку тайм-аута. talk.google.com:5222 Исключение: не удалось подключиться к talk.google.com:5222.; : тайм-аут удаленного сервера (504) -- вызвано: java.net.UnknownHostException: talk.google.com