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");
}
}
}