connection error

17 views
Skip to first unread message

Anuradha

unread,
Oct 3, 2009, 12:28:10 PM10/3/09
to jabber-net
hello people
I'm trying to create a custom Gtalk client. but when I tried to
connect to the server. It gives me this error."No connection could be
made because the target machine actively refused it"
I'm using C#.net (2.0v) in windowsXP.

This is my code :

public partial class frmGTKEx : Form
{
public frmGTKEx()
{
InitializeComponent();

}

bool JbTestClient_OnInvalidCertificate(object sender,
System.Security.Cryptography.X509Certificates.X509Certificate
certificate, System.Security.Cryptography.X509Certificates.X509Chain
chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
if (sslPolicyErrors ==
System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch)
return true;
else
return false;
}

private void JbTestClient_OnMessage(object sender,
jabber.protocol.client.Message msg)
{
jabber.protocol.client.Message reply = new
jabber.protocol.client.Message(JbTestClient.Document);
reply.Body = "hello";
reply.To = msg.From;
JbTestClient.Write(reply);
}

private void frmGTKEx_Load(object sender, EventArgs e)
{
try
{
JbTestClient.Connection =
jabber.connection.ConnectionType.Socket;
JbTestClient.Server = "gmail.com";
JbTestClient.User = "username";
JbTestClient.Password = "password";
JbTestClient.Connect();
JbTestClient.Login();
JbTestClient.OnAuthenticate += new
bedrock.ObjectHandler(JbTestClient_OnAuthenticate);
JbTestClient.OnInvalidCertificate += new
System.Net.Security.RemoteCertificateValidationCallback
(JbTestClient_OnInvalidCertificate);

}
catch (Exception ex)
{


}

}

void JbTestClient_OnAuthenticate(object sender)
{
MessageBox.Show("done");
}
}
}

Max Lynch

unread,
Oct 7, 2009, 1:39:26 PM10/7/09
to jabbe...@googlegroups.com
I believe that the server address is "talk.google.com" rather than gmail.com
Reply all
Reply to author
Forward
0 new messages