Hunt down java.net.SocketException: No buffer space available

前端 未结 3 1974
囚心锁ツ
囚心锁ツ 2021-01-12 03:35

Hi I have very ugly problem with: java.net.SocketException: No buffer space available (maximum connections reached?) It is client-server app. Client is Windows XP SP2 32

3条回答
  •  生来不讨喜
    2021-01-12 04:26

    After reading the advice offered in this link! I was able to determine that I was using isDisplayed() way too often in too short of a time. Therefore, I placed a 5 millisecond wait between calls to isDisplayed. This fixed my Socket Exception issue.

        for (final WebElement person: persons){
            if (person.isDisplayed()){
                dosomething;
                sleep 5 milliseconds
            }
        }
    

    As stated in the link you should insert a try catch just in case this wait is not long enough.

提交回复
热议问题