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:
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.
Thanks again for any help.
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
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();
}
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.