PC Review


Reply
Thread Tools Rate Thread

Always takes 100s to establish connection...why??

 
 
=?Utf-8?B?VEo=?=
Guest
Posts: n/a
 
      12th May 2004
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 connecte
to FTP server.
First of all, I have granted full trust for security. So it is not related with an
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 connectio
is established immediately. I really don't know why it always exactly takes 100s whe
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()
..
..
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
takes >60 secs after system start to establish network connect Steve Richter Windows Vista Networking 4 22nd Jan 2008 10:09 PM
Can't establish a VPN Connection =?Utf-8?B?YmxhY2tub2lzZQ==?= Windows Vista Networking 2 24th Jun 2007 06:57 PM
Can't Establish FTP Connection =?Utf-8?B?TWFyaw==?= Windows XP Networking 1 4th Jun 2005 06:38 PM
Can't establish a DDE connection? Kristen Microsoft Excel Misc 0 9th Jul 2004 06:52 PM
always exactly 100s to establish connection...why?? =?Utf-8?B?VEo=?= Microsoft C# .NET 1 12th May 2004 11:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:36 AM.