Releasing bound ports on process exit

前端 未结 3 535
野趣味
野趣味 2020-12-05 08:04

How do I make sure that a socket bound to a port is properly released on process exit such that the port can be reused without bind() failing with EADDRINUSE? I

3条回答
  •  Happy的楠姐
    2020-12-05 08:55

    Not exactly an answer to your question, but for completeness:

    On Windows you can set the TcpTimedWaitDelay registry value to set the timeout for releasing closed TCP connections to as low as 30 seconds.

提交回复
热议问题