Subject: Immediate Disconnect
Sorry to bother you Alex, but I have one more question. So I got everything set up once I fixed that error earlier.
Basically here's my problem: right after the connection is open, it immediately disconnects.
I can tell its disconnected because I traced through all the functions printing output:
Updating Google Talk Presence:
Calling INITSocket
Socket: ClientSocket
Calling _Open
Opening Socket
Calling SocketConnect sp
Calling SocketConnect
Calling DoChangeXmppConnectionState: Connecting
Connecting...
Calling DoChangeXmppConnectionState: Connected
Calling DoChangeXmppConnectionState: Disconnected
So the state in DoChangeXmppConnectionState is disconnected when I haven't called the Close yet. Here's my code:
Do you know why it's immediately disconnecting? Is it because of a login failure perhaps? or is my setup config incorrect?
Basically here's my problem: right after the connection is open, it immediately disconnects.
I can tell its disconnected because I traced through all the functions printing output:
Updating Google Talk Presence:
Calling INITSocket
Socket: ClientSocket
Calling _Open
Opening Socket
Calling SocketConnect sp
Calling SocketConnect
Calling DoChangeXmppConnectionState: Connecting
Connecting...
Calling DoChangeXmppConnectionState: Connected
Calling DoChangeXmppConnectionState: Disconnected
So the state in DoChangeXmppConnectionState is disconnected when I haven't called the Close yet. Here's my code:
public static void updatePresence(MyUserSettings mySettings, string presence)
{
Console.WriteLine("Updating Google Talk Presence:");
XmppClientConnection xmpp = new XmppClientConnection();
xmpp.Server = "gmail.com";
xmpp.ConnectServer = "talk.google.com";
xmpp.Port = 5222;
xmpp.Open(mySettings.GTalk_Username, mySettings.GTalk_Password, "private_resource_name", 10);
//Console.WriteLine("Updating Presence:");
//xmpp.Status = presence;
//xmpp.OnLogin += delegate(object o) { Console.WriteLine("Logged in"); xmpp.SendMyPresence(); xmpp.Close();};
}
{
Console.WriteLine("Updating Google Talk Presence:");
XmppClientConnection xmpp = new XmppClientConnection();
xmpp.Server = "gmail.com";
xmpp.ConnectServer = "talk.google.com";
xmpp.Port = 5222;
xmpp.Open(mySettings.GTalk_Username, mySettings.GTalk_Password, "private_resource_name", 10);
//Console.WriteLine("Updating Presence:");
//xmpp.Status = presence;
//xmpp.OnLogin += delegate(object o) { Console.WriteLine("Logged in"); xmpp.SendMyPresence(); xmpp.Close();};
}
Do you know why it's immediately disconnecting? Is it because of a login failure perhaps? or is my setup config incorrect?