Last post Feb 16, 2010 04:56 AM by jmmata
Feb 04, 2010 11:47 AM|jmmata|LINK
Hi everyone, I have an HttpHandler that runs the following code:
Uri targetUri = new Uri("http://<IP>:8090/test?q=<query>");
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(targetUri);
StreamReader stream = new StreamReader(webRequest.GetResponse().GetResponseStream());
if (stream != null) stream.Close();
It works fine in my local machine for both, the default port 80 and the different 8090 but in my hosting it doesn't works for the 8090, returning "Unable to connect to the remote server" after few seconds.
Anyone knows some workaround to call ports different than the 80?
Thanks in advance!
non standard ports
Feb 04, 2010 03:05 PM|Matt-dot-net|LINK
nothing wrong with your code, but something wrong with your server. Log in to server and try "telnet <IP> <port>" if you can't connect then you are being blocked by your firewall or theirs.
Feb 16, 2010 04:56 AM|jmmata|LINK
Solved, my hosting provider opened the port and everything works fine. Thanks.