the socket can't bind?

SnaiX nayuhz at gmail.com
Fri Jan 11 06:06:32 PST 2008


Hi all,
I attempt to run a program like this:
1. make a socket
2. set socket option with SO_REUSEADDR.
3. bind it
4. listen... accept...etc..

Alright, it works well. And I kill it, it can bind immediately.

After this, I do:
5. close all fd.
6. reload it with execvp.

So it would run 1-4. but it reports EADDRINUSE after bind.

Why? How to resolve it? Should I dup() the fd?

Thanks




More information about the freebsd-net mailing list