Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to connect Gtalk using jabber protocol/XMPP in c#. As i am new to use this and need help, I need to connect directly to Gtalk application. This below code which i tried is poping up error :

CODE:
JabberClient jc = new JabberClient();
jc.User = "UserName@gmail.com";
jc.Server = "gmail.com";
jc.Password = "password";

jabber.protocol.client.Message reply = new jabber.protocol.client.Message(jc.Document);

jc.Connect();
while (jc.IsAuthenticated == false)
{
jc.User = "UserName@gmail.com";
jc.Server = "gmail.com";
jc.Password = "password";
jc.Connect();
// System.Threading.Thread.Sleep(10);
}

jc.Message("Receiver@gmail.com", "this is a test");
System.Threading.Thread.Sleep(1000);
jc.Close();

Console.ReadLine();

ERROR POP-UPS:

Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
at SocketStanzaStream.InitializeStream()
at XmppStream.InitializeStream()
at XmppStream.SendNewStreamHeader()
at XmppStream.jabber.connection.IStanzaEventListener.Connected()
at SocketStanzaStream.bedrock.net.ISocketEventListener.OnConnect(BaseSocket sock)
at AsyncSocket.ExecuteConnect(IAsyncResult ar)
at LazyAsyncResult.Complete(IntPtr userToken)
at ContextAwareResult.CompleteCallback(Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at ContextAwareResult.Complete(IntPtr userToken)
at LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at _IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Please Let me know is there any solution for this.

Thanks and Regards,
Swathi Joshi
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900