Reputation: 41
I am trying to get an FTP application up and running on Windows Server 2003, before this application was on windows XP professional running with no problem. I have tried googling around for answers, but the only "workaround" I can seem to find on Microsoft’s website didn’t correct the problem (being edit the registry and add a new field DisableRawSecurity with a value of 1(in the correct area). I am debugging this application in VB .Net
The exception: An attempt was made to access a socket in a way forbidden by its access permissions. As requested here is the source code of the sub its hitting the problem on:
Private Sub Listen()
Try
ListenerSocket.Bind(LocalEndPoint)
ListenerSocket.Listen(100)
While True
ListenerSocket.BeginAccept(New AsyncCallback(AddressOf AcceptCallback), ListenerSocket)
End While
Catch ex As System.Exception
Stop
End Try
ListenerSocket.Shutdown(SocketShutdown.Both)
End Sub
Any help would be appreciated.
Upvotes: 1
Views: 462
Reputation: 7594
Are you even using Raw sockets in your application? If not, then that KB article does not apply, and your exception is due to some other reason.
Upvotes: 0
Reputation: 4123
You might be having a problem because the call to BeginAccept is in an infinite loop. You should only be calling that once until the AsyncCallback is hit, then call EndAccept and BeginAccept again. So essentially you call BeginAccept once to start, and then again after every connection is established.
Upvotes: 1
Reputation: 12795
Everything in Windows has an Access Control List (ACL). It sounds to me like the user running your application does not have the proper permissions in the ACL to do do what you are asking it to do. I'm not sure how you would go about finding the ACL for a raw socket, but thats where I would start looking.
Upvotes: 0