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

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


        
11条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 12:25

    I had a similar problem but I fixed it with by doing some changes in firewall setting.

    You can follow the below steps

    1. Go to "Start" --> "Control Panel"
    2. Click on "Windows Firewall"

    3. Inside Windows Firewall, click on "Allow a program or feature through Windows Firewall"

    4. Now inside of Allow Programs, Click on "Change Settings" button. Once you clicked on Change Settings button, the "Allow another program..." button gets enabled.

    5. Click on "Allow another program..." button , a new dialog box will be opened. Choose the programs or application for which you are getting the socket exception and click on "Add" button.

    6. Click OK, and restart your machine.

    7. Try to run your application (which has an exception) with administrative rights.

    I hope this helps.

    Peace,

    Sunny Makode

提交回复
热议问题