always exactly 100s to establish connection...why??

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: TJ (anonymous_at_discussions.microsoft.com)
Date: 05/12/04


Date: Wed, 12 May 2004 02:26:04 -0700

Dear Sir/Madam.

I made one user control using C#(.NET Runtime is 1.1). It is embeded in Internet Explorer.
Basically, this control is very similiar to FTP client program. So it should be connected
to FTP server.
First of all, I have granted full trust for security. So it is not related with any
security reason at all.

I tried to make code to connect to FTP server in the control.
However, it always takes exactly 100s to establish connection with the server.
It is so long long long time, isn't it?.. Once I made one connection, next connection
is established immediately. I really don't know why it always exactly takes 100s when
connection is established first-time.
Of course, if I tested this same code in the normal windows form, there is no performance
problem at all..In other words, the connection is established immediately.

If you have any ideas, please please let know why, and how I can work around this problem.

Here is some code..
Start method is called to make connection to the FTP Server.

public void Start()
{
        AsyncCallback callback = new AsyncCallback(ConnectionEstablished);
        this.BeginLogin(callback);
}

private delegate void LoginCallback();
public System.IAsyncResult BeginLogin( System.AsyncCallback callback )
{
        LoginCallback ftpCallback = new LoginCallback(this.Login);
        return ftpCallback.BeginInvoke(callback, null);
}
                

private void OpenConnection(IAsyncResult result)
{
        if(result.IsCompleted)
        {
                MessageBox.Show("Connection is established!");
                 }
}

private void Login() {
        ....
        ...
        ftp.Connect("serveraddress","port","uname","password");
        String currentDir = ftp.GetCurrentDirectory();
        ...
        ...
        ..
}

Thank you in advance.



Relevant Pages

  • Always takes 100s to establish connection...why!?
    ... this control is very similiar to FTP client program. ... it always takes exactly 100s to establish connection with the server. ... private void OpenConnection ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Always takes 100s to establish connection...why??
    ... this control is very similiar to FTP client program. ... it always takes exactly 100s to establish connection with the server. ... private void OpenConnection ...
    (microsoft.public.dotnet.general)
  • Re: Always takes 100s to establish connection...why!?
    ... this control is very similiar to FTP client program. ... > I tried to make code to connect to FTP server in the control. ... Once I made one connection, ... > private void OpenConnection ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: always exactly 100s to establish connection...why??
    ... this control is very similiar to FTP client program. ... > I tried to make code to connect to FTP server in the control. ... Once I made one connection, ... > private void OpenConnection ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Iptables FTP question
    ... You would only need RELATED set in your rule for port 21 if you were ... allowing it to deal with related ICMP traffic for the control ... As far as the ftp module specifically, ... secondary connection then becomes an established connection. ...
    (comp.security.firewalls)