473,386 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

TJ
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","passwo rd")
String currentDir = ftp.GetCurrentDirectory()
..
..
Nov 16 '05 #1
1 1882
It is very likely that the problem is the resolution of the timer you are
using.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
"TJ" <an*******@discussions.microsoft.com> schrieb im Newsbeitrag
news:FF**********************************@microsof t.com...
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","passwo rd");
String currentDir = ftp.GetCurrentDirectory();
...
...
..
}

Thank you in advance.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Miran Kopmajer | last post by:
I have Oracle JDeveloper10g installed on my computer and connection to Oracle AS works fine but connection to database returns Io exception: The Network Adapter could not establish the connection...
0
by: TJ | last post by:
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...
4
by: gaffar | last post by:
Sir, I am developing an application in vb.net and the backend database is ms-access. i have created ms-access databse and tables and assigned primary keys to the tables through the vb.net...
3
by: Randy | last post by:
Hello, I've got a Windows client app which hits a web service. The web service works fine unless I'm outside the firewall using a VPN connection. I know my VPN connection is working fine because I...
3
by: Bill | last post by:
I'm running a C#.Net application that is using the HttpWebRequest to upload an xml file to a https site with FIPS complicancy turned on. On the "GetRequestStream()" method I get: "The underlying...
4
by: konsu | last post by:
hello, my client code communicates with a web service through a https connection. the code has a stub derived from SoapHttpClientProtocol. It also sets a certificate policy handler that allows...
1
by: gaffar | last post by:
Sir, I am developing an application in vb.net and the backend database is ms-access. i have created ms-access databse and tables and assigned primary keys to the tables through the vb.net...
3
by: Ted | last post by:
In WSAT, I get the following error when trying to set up my provider: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site...
4
by: Joel Barsotti | last post by:
I'm working on shipping rate calculator going back and forth via XML. The thing I'm confused about is that the code works, but after a few hours and I don't know how many requests, I start getting...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.