always exactly 100s to establish connection...why??
From: TJ (anonymous_at_discussions.microsoft.com)
Date: 05/12/04
- Next message: Liz: "Calling an executable from .NET"
- Previous message: Hammad Rajjoub: "RE: Project management, multiple directories and namespaces"
- Next in thread: cody: "Re: always exactly 100s to establish connection...why??"
- Reply: cody: "Re: always exactly 100s to establish connection...why??"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: Liz: "Calling an executable from .NET"
- Previous message: Hammad Rajjoub: "RE: Project management, multiple directories and namespaces"
- Next in thread: cody: "Re: always exactly 100s to establish connection...why??"
- Reply: cody: "Re: always exactly 100s to establish connection...why??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|