diff audioDB.cpp @ 92:caf4ec67ddaf

Give in to expediency and use SO_REUSEADDR on the bind() call. (Allows test cases to be run in quick succession. Possibly allows other stuff, positive and negative.)
author mas01cr
date Wed, 03 Oct 2007 13:53:39 +0000
parents 28211402b9c6
children 69424e77621f
line wrap: on
line diff
--- a/audioDB.cpp	Wed Oct 03 13:53:01 2007 +0000
+++ b/audioDB.cpp	Wed Oct 03 13:53:39 2007 +0000
@@ -2482,6 +2482,13 @@
   struct soap soap;
   int m, s; // master and slave sockets
   soap_init(&soap);
+  // FIXME: largely this use of SO_REUSEADDR is to make writing (and
+  // running) test cases more convenient, so that multiple test runs
+  // in close succession don't fail because of a bin() error.
+  // Investigate whether there are any potential drawbacks in this,
+  // and also whether there's a better way to write the tests.  --
+  // CSR, 2007-10-03
+  soap.bind_flags |= SO_REUSEADDR;
   m = soap_bind(&soap, NULL, port, 100);
   if (m < 0)
     soap_print_fault(&soap, stderr);