Location:
Search - eaddrinuse bi
Search list
Description: bind 普遍遭遇的问题是试图绑定一个已经在使用的端口。该隐患是也许没有活动的套接字存在,但仍然禁止绑定端口(bind 返回 EADDRINUSE),它由 TCP 套接字状态 TIME_WAIT 引起。该状态在套接字关闭后约保留 2 到 4 分钟。在 TIME_WAIT 状态退出之后,套接字被删除,该地址才能被重新绑定而不出问题。本文提出了解决该问题的方法。-bind common problem encountered is trying to bind a port already in use. The hidden danger is no active socket may exist, but are still prohibited to bind to port (bind to return EADDRINUSE), it is caused by the TCP socket TIME_WAIT state. The state retained in the socket after the closure of about 2 to 4 minutes. Out in the TIME_WAIT state, the socket is deleted, the address can be re-bound without problems. In this paper, to solve the problem.
Platform: |
Size: 1024 |
Author: 与乁 |
Hits: