an attempt was made to access a socket in a way forbbiden by its access permissions. why?

前端 未结 11 1140
北荒
北荒 2020-11-28 11:49
 private void StartReceivingData(string ipAddress, int iPort)
    {
        try
        {
            if (!_bContinueReciving)
            {
                //initia         


        
相关标签:
11条回答
  • 2020-11-28 12:01

    I ran into this in a Web App on Azure when attempting to connect to Blob Storage. The problem turned out to be that I had missed deploying a connection string for the blob storage so it was still pointing at the storage emulator. There must be some retry logic built into the client because I saw about 3 attempts. The /devstorageaccount1 here is a dead giveaway.

    Fixed by properly setting the connection string in Azure.

    0 讨论(0)
  • 2020-11-28 12:07

    This is the error that is returned when the Windows Firewall blocks the port (out-going). We have a strict web server so the outgoing ports are blocked by default. All I had to do was to create a rule to allow the TCP port number in wf.msc.

    0 讨论(0)
  • 2020-11-28 12:08

    Most likely the socket is held by some process. Use netstat -o to find which one.

    0 讨论(0)
  • 2020-11-28 12:10

    I had the same error happening when I had two different ASP.net projects in two different Visual Studio instances.
    Closing one of them fixed the issue.

    0 讨论(0)
  • 2020-11-28 12:11

    Well I don't even understand the culprit of this problem. But in my case the problem is totally different. I've tried running netstat -o or netstat -ab, both show that there is not any app currently listening on port 62434 which is the one my app tries to listen on. So it's really confusing to me.

    I just tried thinking of what I had made so that it stopped working (it did work before). Well then I thought of the Internet sharing I made on my Ethernet adapter with a private virtual LAN (using Hyper-v in Windows 10). I just needed to turn off the sharing and it worked just fine again.

    Hope this helps someone else having the same issue. And of course if someone could explain this, please add more detail in your own answer or maybe as some comment to my answer.

    0 讨论(0)
  • 2020-11-28 12:16

    Running iisreset in a command window fixed it for me.

    0 讨论(0)
提交回复
热议问题