What is "java.net.NoRouteToHostException: Cannot assign requested address"?

Jason picture Jason · Aug 2, 2016 · Viewed 15.1k times · Source

That's it. I have never seen before. I am trying Tcp Holepunching.

One Client should be both client and server(for other client).

I got this Exception. Is there anyone who know about this problem?

java.net.NoRouteToHostException: Cannot assign requested address
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at com.temp.TcpSocketClient$4.run(TcpSocketClient.java:563)
    at java.lang.Thread.run(Thread.java:745)

Answer

吴少东 picture 吴少东 · Mar 7, 2019

hey can you check you request is use keep-Alive option? If you are doing a stress test, please try turning it off.