Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.22/5 (2 votes)
See more:

Hello,

I wrote a web service that reads data from a remote server. The client application which uses this web service, is working fine on Windows XP. When trying to run the client application on Vista, I get the following exception:

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions:..."

I am running the client application as an administartor on Vista.

Can somebody tell me whats wrong?

Thank you,

TR

Posted
Updated 30-May-18 17:14pm

Turn off your firewall? If it works, then your firewall is blocking something and you can then do some investigation to figure out exactly what. Once you know that, you can add a rule that opens up whatever your firewall is blocking. According to this page, it could also be that another program is attempting to access the same socket. Perhaps you are not closing the socket correctly before creating a new one, so you are stepping on your own toes. Or maybe another program is attempting to access the same remote server. Not quite sure, but those are some ideas for you to look into.
 
Share this answer
 

Vista sucks. When you get a specific error, googling it in quotes is the best way to find help. I did that for you, and the main thing I found was that having too many SQL Server connections open can cause this error. Someone else solved it by installing the Visual Studio patch for VS 2005 products (including the Express editions) for Vista.  Everyone agreed - Vista sucks.

 
Share this answer
 
Comments
raja mohamed 9-May-13 5:03am    
based on this commments i have resolved my issue. Thanks christian.
Thank you very much,
The firewall caused this problem.

TR
 
Share this answer
 
Comments
Bdrap 4-Feb-13 1:45am    
My firewall is disabled and my anti-virus as well. I can visit the site through my browser but get the error:

2013/02/04 08:23:09 AM ==> Unable to connect to the remote server System.Net.Sockets.SocketException (0x80004005): 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 196.30.46.204:86
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)

in my web service. Please help ?

Hi,

Thank you. I am working with Visual Studio 2008. Is there also a patch for VS2008?

Do you mean that there are too many SQL connections on the client PC?

TR.

 
Share this answer
 
I really don't know, I used google to find an answer for you, I've not had the issue.  They meant too many connections to SQL Server are open.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900