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.
精彩评论