How to avoid a NoRouteToHostException?

后端 未结 6 1873
傲寒
傲寒 2020-12-02 06:09

Disclosure: the code I\'m working on is for university coursework.

Background: The task I\'m trying to complete is to report on the effect of different threading tec

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-02 06:38

    If you're running out of source ports but aren't actually maintaining that many open connections, set the SO_REUSEADDR socket option. This will enable you to reuse local ports that are still in the TIME_WAIT state.

提交回复
热议问题