A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Hi All,

 I have created a FTP client in ASP.net and it's working fine on my local system but when i deployed this code on Public IP(Remote server) it's not working.Code and Exceptions message are give below.


 

public void Login()
		{
			if ( this.loggedin ) this.Close();

			Debug.WriteLine("Opening connection to " + this.server, "FtpClient" );

			IPAddress addr = null;
			IPEndPoint ep = null;

			try
			{
				this.clientSocket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp );
				addr = Dns.Resolve(this.server).AddressList[0];
				ep = new IPEndPoint( addr, this.port );
				this.clientSocket.Connect(ep);
			}
			catch(Exception ex)
			{
				// doubtfull
				if ( this.clientSocket != null && this.clientSocket.Connected ) this.clientSocket.Close();

				throw new FtpException("Couldn't connect to remote server",ex);
			}

			this.readResponse();

			if(this.resultCode != 220)
			{
				this.Close();
				throw new FtpException(this.result.Substring(4));
			}

			this.sendCommand( "USER " + username );

			if( !(this.resultCode == 331 || this.resultCode == 230) )
			{
				this.cleanup();
				throw new FtpException(this.result.Substring(4));
			}

			if( this.resultCode != 230 )
			{
				this.sendCommand( "PASS " + password );

				if( !(this.resultCode == 230 || this.resultCode == 202) )
				{
					this.cleanup();
					throw new FtpException(this.result.Substring(4));
				}
			}

			this.loggedin = true;

			Debug.WriteLine( "Connected to " + this.server, "FtpClient" );

			this.ChangeDir(this.remotePath);
		}
 

Santosh kumar
Mark as Answer on the post that helped you.



Blog
0
santosh
6/12/2008 7:21:20 AM
asp.net.getting-started 91979 articles. 3 followers. Follow

5 Replies
1353 Views

Similar Articles

[PageSpeed] 50

Check if the server you are trying to connect to is accessible from your server and there is no firewall blocking it or not added to your DNS  


Hosam Kamel

Remember to click on Mark as answer on the post that helped you
0
HosamKamel
6/12/2008 8:59:33 AM

Please make sure that Firewall and antivirus are not creating problem in connection....

 

 



View Blog

linkedin Asp.net Group

Don't forget to click “Mark as Answer” on the post that helped you
0
sameer_khanjit
6/12/2008 9:02:50 AM

 Hi ,

thanks for quick reply .I can  ping FTP server from Public  IP(Remote Server) address and also there is no firewall blocking.I am not sure about DNS.


Santosh kumar
Mark as Answer on the post that helped you.



Blog
0
santosh
6/12/2008 10:11:32 AM

Try to Enabling Network Tracing and trace your connectivity.


Hosam Kamel

Remember to click on Mark as answer on the post that helped you
0
HosamKamel
6/13/2008 12:18:34 PM

Hi,

Please make sure it is able to connect from the production server to the server specified in ASP.NET application. Run a ping command from command line prompt to the server's IP address or server name to see the results. You should be able to see the results from command prompt which will indicate whether the connection is successful or not.

According to your description, the server might locate in the same machine or in the same intranet. For production enviroment, you might need to have similar deployment. 


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
0
Zhao
6/17/2008 7:10:30 AM
Reply:

Similar Artilces:

"A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond IP:PORT"
 Hi all, "A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond IP:Port"  this is the error i am geeting while sending an email using System.Net.Mail My Code here :MailMessage objMail;        SmtpClient objSMTP;        // Now create the email        objMail = new MailMessage();        objMail.To.Add...

VS2005 IDE: Add Web Refernece. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has fa
 I have published a web service, but cannot connect to it in VS2005.  The Web Methods display, but I then get this error:A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond I CAN connect to it outside of VS2005 from IE, Stylus Studio, etc.  /Bob C in GRR Hi  Bob, That might be a problem with proxy. Please try this solution: http://west-wind.com/weblog/posts/3871.aspx. Also you can refer to this article: http://msdn.microsoft...

A connection attempt failed because the connected party did not properly respond after a period of time
 When trying to send an email I'm getting this error. What does it mean? Thanks.A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 216.34.131.135:25 Regards, Curt It means that a connection could not be established to the host at 216.34.131.135 on port 25 I have tried to connect to that host, and it is not accepting mail on port 25 The simple way to test this is go to the command prompt and type: telnet 216.34.131.135 25 this will try and ...

Connection Failed Activation of Network Connection Failed
I am running openSUSE 12.1 Beta 1 GNOME and I cannot get an internet connection. The wireless on my laptop says missing firmware which is fine. It says this on any distro and I can get it working. However, I can not get my wired connection to work. It keeps trying to connect and says "Connection Failed Activation of Network Connection Failed. I have seen other people have this problem online somewhere and they said they had to swap something from manual to auto, but I am not sure what or where. I know that this laptops ethernet card will work fine on here b/c I used ope...

superreview granted: [Bug 219376] Trying to resolve IP's via DNS (Failed connections stall instead of giving Connection Failure Error; pages stop/don't finish/complete loading if ad hosts/scripts fail
Brian Ryner <bryner@brianryner.com> has granted Darin Fisher <darin@meer.net>'s request for superreview: Bug 219376: Trying to resolve IP's via DNS (Failed connections stall instead of giving Connection Failure Error; pages stop/don't finish/complete loading if ad hosts/scripts fail) http://bugzilla.mozilla.org/show_bug.cgi?id=219376 Attachment 132718: v1.1 patch http://bugzilla.mozilla.org/attachment.cgi?id=132718&action=edit ...

not connected when I am connected
What do I need to change on my 'puter when the icon in the toolbar shows and tells me I am connected and the error message tells me I am not and I can not go to web pages, get or send emails. I have to close down and restart to get connected again. This only happens if I am on line and leave the 'puter for an hour or so. As long as I am using it I don't have a problem. This just started about a month ago. I am on very slow dialup, DSL and Cable not in my area, thanks you SBC/ATT tks Elaine wrote: > What do I need to change on my 'puter when the icon in ...

Failed to Connect Firefox can't establish a connection
Hello, I get "Failed to Connect Firefox can't establish a connection to the server at 127.0.0.1:3580." when I try to open a Help File of one of the applications I have. My /etc/hosts file has its entries right: 127.0.0.1 hostname.hostdomain hostname My firewall is also disabled. nmap -sT -O localhost gives me (I have included some): 2401/tcp open cvspserver 2601/tcp open zebra 5900/tcp open vnc 8009/tcp open ajp13 8085/tcp open unknown Device type: general purpose Running: Linux 2.6.X OS details: Linux 2.6.17 - 2.6.25 I understand that the port ...

Connection established
Huge problem at the moment: I am connected to the internet via Wifi (NetworkManager) - and Konqueror tells me I am ONLINE in our local library. They run an open network and users need to log in on a special website to get full internet access. As stated, my computer tells me I would be online, but I don�t have any connection (neither via FF, nor via Konqueror). Same applies when connected via Ethernet. Oh, and I�ve already tried to use and change settings with traditional method with ifup... Strange: In my own villa everything works perfect. * ANY HELP IS VERY MUCH APPRECTIATED. ...

database connection failed with connection cache
I have a connection cache on jag 3.6.1 using com.sybase.jdbc2.jdbc.sybdrives. I am able to ping the connection in jag manager. My problem is in PowerJ 3.6.1. I setup a transaction object using the database wizard(very cool), change it to use a cache and even find the connection cache on the server. when I try to test the connection, I first select a profile jconnect5 and try the connection. I get this error: database connection failed jz006: cought a IoException java.net.connectionException connection refused, no further info. any ideas would be great! You can only...

System.Exception: System.Web.HttpException: The transport failed to connect to the server. System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server.
I have an application which creates about 50 XML packages and sends a notification about the success/failure of every package. I am running this code in threads and I have restricted maximum no. of threads that can be active at any time to 2.So the package generation and the notification would be performed for 2 packages in parallal. But while sending notifications to users, I am getting the below error only for very few packages[ 1 or 2 out of 50] . The same base code is used by all the packages but i am getting this error intermittently. System.Exception: Error sending mail to [So...

Web resources about - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond - asp.net.getting-started

Category:Awards established in 1970 - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

FiftyThree, Developer Of Established Paper App, Urges Facebook To Change Name Of Its New App
... York-based startup FiftyThree posted a statement on its website urging Facebook to change the app’s name, since it launched its own, well-established ...

Friends of Mike Patterson Trust Established - Facebook
Friends Of Mike Patterson hat eine Notiz mit dem Titel Friends of Mike Patterson Trust Established geschrieben. Du kannst den vollständigen Text ...

Which Established Facebook Platform Apps Are Spreading Most Quickly Today?
On the first official day of Q3 2009, which established apps are still growing the most quickly? Here are the numbers from AppData on today’s ...

Beats by Dre: "Re-Established 2014” Trailer - YouTube
Beats by Dre debuts “Re-Established 2014.” See the place that made LeBron James. "I mean everything to this city and this city means everything ...

Judicial watchdog established despite concerns from Bar Association
A new judicial watchdog has been established to hold judges and magistrates accountable for minor offences and to respond to complaints from ...

Renewable energy target slashed, wind farm commissioner to be established
A bipartisan deal - agreed to last month after a lengthy political stalemate that hamstrung the clean energy sector - will slash the renewable ...

Sydney siege: Foundation established in memory of victim Katrina Dawson
The family of Sydney siege victim Katrina Dawson has established a foundation in her memory, and have also made plans for a memorial service ...

Good life flows from established vineyard
A boutique winery and residence is on the market, and will appeal to discerning wine lovers.

Newly established Men's Shed robbed, trashed - The Courier
SEBASTOPOL Men’s Shed members feel violated after their facility was broken into and valuable items were stolen.

Resources last updated: 12/26/2015 12:44:42 AM