string ret = GetPageContent( " http://202.xx.xx.xx/smpp.sms?username=12341234&password=12345&to=919999999999&from=AD-ADAD&text=Dear Parent,testing..." ); public static string GetPageContent( string FullUri) HttpWebRequest Request; StreamReader ResponseReader; Request = ((HttpWebRequest)(WebRequest.Create(FullUri))); ResponseReader = new StreamReader(Request.GetResponse().GetResponseStream()); return ResponseReader.ReadToEnd(); it is run on my system from vs 2008 or from IIS working fine...
but when installing in client pc it is throwing an exception
"Unable to connect to the remote server"
after a long search on internet i found some suggestions like including some changes in web.config file like
<system.net> <defaultProxy> <proxy proxyaddress = " http://202.xx.xx.xx" bypassonlocal = " true" /> </ defaultProxy > </ system.net >
and also am getting the same error after that i opened command prompt and type ping 202.xx.xx.xx it is show timeout for every request packets sent 4 recieved 0 (100% loss) is showed in command prompt
and also done with another process like:
i just uninstalled anti-virus and turned-off firewall and also not woking...
i spand lack of time in internet am still unable find solution please can any help me please
thanks in advance...
fulluri is valid and have correct credentials sir because it is working on my local iis server. i think it is taking long time to respond and finally showing unable to connect remote server
and in cmd prompt ping 202.xx.xx.xx--> it is show timeout for every request packets sent 4 recieved 0 (100% loss)
for more details regarding the issue:

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 202.xx.67.xx:80
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: 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 202.62.67.34:80

Source Error:

Collapse | Copy Code

Line 471: StreamReader ResponseReader;
Line 472: Request = ((HttpWebRequest)(WebRequest.Create(FullUri)));
Line 473: ResponseReader = new StreamReader(Request.GetResponse().GetResponseStream());
Line 474: return ResponseReader.ReadToEnd();
Line 475: }


Source File: c:\inetpub\wwwroot\vardhaman\fees\createuser.aspx.cs Line: 473

Stack Trace:


[SocketException (0x274c): 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 202.xx.xx.xx:80]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224

[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetResponse() +5386189
fees_createuser.GetPageContent(String FullUri) in c:\inetpub\wwwroot\vardhaman\fees\createuser.aspx.cs:473
fees_createuser.Testmsgbtn_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\vardhaman\fees\createuser.aspx.cs:455
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.5420; ASP.NET Version:2.0.50727.5420

please can any help me please

thanks in advance..
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = " GET" ; request.AllowAutoRedirect = false ; request.Credentials = CredentialCache.DefaultCredentials; request.Accept = " */*" ; request.ContentType = " application/x-www-form-urlencoded" ; request.UserAgent = " Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5" ; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream dataStream = response.GetResponseStream(); StreamReader SR = new StreamReader(dataStream, Encoding.UTF8); webresponse = SR.ReadToEnd(); response.Close(); dataStream.Close(); SR.Close(); finally request.Abort(); catch { } return webresponse;
sir i got the same problem after using your code block at this line : HttpWebResponse response = (HttpWebResponse)request.GetResponse();
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 202.xx.xx.xx:80
sir may i change any internet settings in client PC or any other changes required..
The below line solved my timeout problem while GetResponse()
request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5";
Thanks mate! Server Error in '/' Application.
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 [2607:f8b0:4003:c06::6c]:25
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: 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 [2607:f8b0:4003:c06::6c]:25
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SocketException (0x274c): 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 [2607:f8b0:4003:c06::6c]:25]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +208
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +464
[WebException: Unable to connect to the remote server]
System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) +6651460
System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) +307
System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +19
System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +324
System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) +141
System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) +170
System.Net.Mail.SmtpClient.GetConnection() +44
System.Net.Mail.SmtpClient.Send(MailMessage message) +1554
[SmtpException: Failure sending mail.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +1906
FlexiMail.Send() in d:\projects\hotelsBooking\App_Code\FlexiMail.cs:206
SendMail.Cancelmail(String UserName) in d:\projects\hotelsBooking\App_Code\SendMail.cs:155
Admin_BookingsView.btncancel_Click(Object sender, ImageClickEventArgs e) in d:\projects\hotelsBooking\Admin\BookingsView.aspx.cs:228
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +124
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •