I tried to use Smack to connect a ejabberd server, but failed.
1. My hosts on ejabberd config:
{hosts, ["macbook.local", "public.macbook.local"]}.
2. My Smack client connection:
Connection connection = new XMPPConnection("macbook.local");
connection.connect();
connection.login(username, pwd);
It failed on connection.connect(), and the error msg say, "". Could not connect to macbook.local:5222.: remote-server-timeout(504) Could not connect to macbook.local:5222.
-- caused by: java.net.UnknownHostException: macbook.local
Any idea?
Thanks in advance.
Does this work for you? $
Does this work for you?
If that fails, then "macbook.local" is an unknown host. Better use "localhost", or some DNS name that is known.