开发者

Linux socket doesn't close

i have a problem. I run a TCP server in linux. I close the socket by close(socket) call. But when I try to rebind again, bind ca开发者_开发知识库ll fails with errno 98 => port is already binded. How should i unbind that socket?


You have to set SO_REUSEADDR option on the socket, see here.


You can try setting the SO_REUSEADDR socket option, see this question for some discussion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜