Differences between version 3 and revision by previous author of EADDRINUSE.
Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History
Newer page: | version 3 | Last edited on Monday, April 14, 2003 12:10:44 am | by PerryLorier | Revert |
Older page: | version 2 | Last edited on Sunday, February 23, 2003 2:05:53 am | by KevinGeorge | Revert |
@@ -9,4 +9,12 @@
kill(1) the other program that is listening on that port and try again.
Usually you get this error when trying to start a daemon that is already running.
+
+----
+To code around this call
+ unsigned int opt = 1;
+ if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt))==-1) {
+ perror("setsockopt(fd,SOL_SOCKET, SO_REUSEADDR,1)");
+ exit(1);
+ }