Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Rrobeo #1
Member since Mar 2008 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: OnLogin event isn't firing
I am just trying to replicate any of the extremely simple GTalk connection examples I have seen.  The latest iteration of my code is below.  For some reason, my OnLogin event never fires (I have tried versions where the handler just throws an ApplicationException too).  I actually get login output to stdout:

Cipher: Rc4 strength 128
Hash: Md5 strength 128
Key exchange: RsaSign strength 1024
Protocol: Tls
Is authenticated: True as server? False
IsSigned: True
Is Encrypted: True
Certificate revocation list checked: True
Remote cert was issued to CN=talk.google.com, O=Google Inc., L=Mountain View, S=
California, C=US and is valid from 4/11/2007 1:20:16 PM until 4/10/2012 1:20:16
PM.
Can read: True, write True
Can timeout: True

But my OnLogin handler never gets invoked.  I have tried this with firewall on and off, and with from account of both username@gmail.com and just username.  Any help would be appreciated, I have no idea what is going on.

I realize the loop/sleep thing is a little lame, its just to get my silly console app to hang while login occurs.  I have also tried with just a 5 second sleep after login and no loop/continue flag.

static XmppClientConnection sm_Connection;
static bool sm_Continue;

    static void Main(string[] args)
    {
        sm_Connection = new XmppClientConnection();
        sm_Connection.Server = "google.com";
        sm_Connection.ConnectServer = "talk.google.com";
        sm_Connection.Username = "username";
        sm_Connection.Password = "******";
        sm_Connection.OnLogin += delegate(object sender) { sm_Continue = true;  sm_Connection.Send(new Message("bryant.robby@gmail.com", MessageType.chat, "testing")); };
       
        sm_Continue = false;
        sm_Connection.Open();

        while(!sm_Continue)
            Thread.Sleep(500);
           
        sm_Connection.Send(new Message("bryant.robby@gmail.com", MessageType.chat, "whattup, dawg?"));
          
        Thread.Sleep(5000);
        sm_Connection.Close();
    }

Thanks again for any help.
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
the problem must be here:
  1. sm_Connection.Server = "google.com";

if your Google ID is something@gmail.com this must be:

  1. sm_Connection.Server = "gmail.com";
  2. sm_Connection.Username = "something";

AFAIK only Google employees have @google.com IDs.
Look also at the Google Talk and MiniClient example in the samples directory.
Software Developer
AG-Software
Avatar
Rrobeo #3
Member since Mar 2008 · 2 posts
Group memberships: Members
Show profile · Link to this post
Yeah, I've looked at those samples probably 50 times by now.  And missed that detail about 50 times.

I'm an idiot.  Thanks for the extra set of eyes.
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