An attempt was made to access a socket in a way forbidden by its access permissions

by admin 5. June 2008 14:25

When I'm trying to access network socket on Vista it's throwing this exception:

An attempt was made to access a socket in a way forbidden by its access permissions

The only workaround I found so far is to run application as Administrator. The code to reproduce it goes like this:

System.Net.Sockets.Socket socket = new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Raw, System.Net.Sockets.ProtocolType.Icmp);

Anyone knows the answer for this problem?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

c# | Vista

Comments are closed

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar