Not logged in. · Lost password · Register
Forum: agsXMPP RSS
unable to connect to Openfire/Wildfire
Avatar
lead2demo #1
Member since Sep 2009 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: _connection.Server = jid.Server;
Hello all!

I'm just new with agsXMPP and when I was building a console app to be able to connect to my server I keep receiving an error message:
"(..) System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="ThinClient"
  StackTrace:
       at ThinClient.Program.Login(String login, String pass) in C:\Program Files\AG-Software\agsXMPP SDK\samples\VS2008\ThinClient\Program.cs:line 27
       at ThinClient.Program.Main(String[] args) in C:\Program Files\AG-Software\agsXMPP SDK\samples\VS2008\ThinClient\Program.cs:line 19
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:
(...)"

I'm just new at this and I hope someone can help me with this! Here is my part of the code where I call/try connect to Server:

static void Login(string login, string pass)
        {
            Jid jid = new Jid(login);

            _connection.Server = jid.Server;
            _connection.Username = jid.User;
            _connection.Password = pass;
            _connection.Resource = "Alejandra's Super Cool Thin Client 2000000";
            _connection.Priority = (int)10;
            _connection.SocketConnectionType = agsXMPP.net.SocketConnectionType.Direct;
            _connection.ConnectServer = "http//127.0.0.1";
            _connection.Port = 9090;
            _connection.UseSSL = false;
            _connection.AutoResolveConnectServer = false;
            _connection.UseStartTLS = true;
            _connection.Open();

    }

Thank you so much for the people who create agsXMPP ;-)  And thank you before hand who takes the time to help me with my error!!!!!
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
ConnectServer and Port is wrong.
Default port for XMPP and Openfire is 5222. If you have installed Openfire on your developer machine then ConnectServer is localhost, but normally mut not be set.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS