Webdriver: java.net.BindException: Address already in use: connect

前端 未结 3 1543
轮回少年
轮回少年 2021-01-02 03:11

While running webdriver, 3 minutes into running, I get the following exception and Webdriver crashes.

I am using only one webdriver instance and one FirefoxDriver pr

3条回答
  •  情深已故
    2021-01-02 03:35

    If your situation is like mine, where you

    1. open port 1
    2. connect to machine
    3. ??
    4. close port 1
    5. open port 1
    6. connect to different machine

    try adding socket.setSoLinger(true, 0); directly before socket.close();.

    Like so:

    socket.setSoLinger(true, 0);
    socket.close();
    

    This forces the OS to release the socket, rather than putting it in a TIME_WAIT state.

提交回复
热议问题