I am trying to register an account on my eJabberd server using the agsXMPP library. This is my code which is pretty much the same like here:
http://www.codeproject.com/Articles/21267/Creating-a-Jabber-Client-using-the-agsXMPP-Library
static void Main(string[] args)
{
string JID_Sender = "newaccount@pc-michi";
string Password = "123";
Jid jidSender = new Jid(JID_Sender);
XmppClientConnection xmpp = new XmppClientConnection(jidSender.Server);
xmpp.RegisterAccount = true;
try
{
xmpp.Open(jidSender.User, Password);
xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Console.Write("Wait for Login ");
int i = 0;
_wait = true;
do
{
Console.Write(".");
i++;
if (i == 10) _wait = false;
Thread.Sleep(500);
} while (_wait);
Console.WriteLine();
}
static void xmpp_OnLogin(object sender)
{
_wait = false;
Console.WriteLine("Logged In");
}
So, this should work fine, which it does sometimes at least. There lies the problem. The account is only created when I restart the server. Why is that possible? I have not changed anything regarding settings on the server, it is freshly installed. I have also already tried to reinstall eJabberd. Still the same result though. Do you know any solutions to this problem? Or is it just something I am missing in the code?
Here you can find my config file: http://textuploader.com/5yu90