Reputation: 21
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 call fails with errno 98 => port is already binded. How should i unbind that socket?
Upvotes: 2
Views: 1368
Reputation: 7275
You have to set SO_REUSEADDR option on the socket, see here.
Upvotes: 3
Reputation: 399793
You can try setting the SO_REUSEADDR
socket option, see this question for some discussion.
Upvotes: 0